[syslinux] tftp-hpa: getopt problems

Gernot Hillier gernot.hillier at siemens.com
Wed Aug 25 04:12:25 PDT 2004


Hi!

Gernot Hillier wrote:
> I experienced quite strange problems when trying to use tftp-hpa in newer
> Cygwin versions. It simply isn't able to parse its command line correctly
> because it seems to use another optind variable than getopt().
[...]
> The attached trivial patch resolves this problem for me and is also the
> suggested way to use getopt according to the man page. 

Sorry for self-replying, but it seems like my patch was filtered... Here is it 
inline:

diff -ur tftp-hpa-0.35/tftpd/tftpd.c tftp-hpa-0.35.new/tftpd/tftpd.c
--- tftp-hpa-0.35/tftpd/tftpd.c	2004-01-08 21:48:30.000000000 +0100
+++ tftp-hpa-0.35.new/tftpd/tftpd.c	2004-08-19 16:07:02.343750000 +0200
@@ -257,6 +257,8 @@
   struct options *opt;
   struct sockaddr_in myaddr;
   struct sockaddr_in bindaddr;
+  extern char *optarg;
+  extern int optind, opterr, optopt;
   int n;
   int fd = 0;
   int standalone = 0;		/* Standalone (listen) mode */


Please apply...

-- 
Bye,

Gernot Hillier
CT SE 2
Siemens AG, Mch P




More information about the Syslinux mailing list