compile error in httpd.c

Max Okumoto max at kiyon.com
Thu Aug 3 10:45:58 UTC 2006


Minor problem with declaration.  The variable 'on' is defined
after an assignment statement, so it doesn't compile on older
version of gcc.

                      Max

Index: networking/httpd.c
===================================================================
RCS file: /opt/cvs/busybox/networking/httpd.c,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 httpd.c
--- networking/httpd.c  9 Jul 2006 19:10:11 -0000       1.1.1.2
+++ networking/httpd.c  3 Aug 2006 10:35:11 -0000
@@ -863,6 +863,7 @@
 {
   struct sockaddr_in lsocket;
   int fd;
+  int on = 1;
 
   /* create the socket right now */
   /* inet_addr() returns a value that is already in network order */
@@ -873,7 +874,6 @@
   fd = bb_xsocket(AF_INET, SOCK_STREAM, 0);
   /* tell the OS it's OK to reuse a previous address even though */
   /* it may still be in a close down state.  Allows bind to succeed. */
-  int on = 1;
 #ifdef SO_REUSEPORT
   setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, (void *)&on, sizeof(on)) ;
 #else

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.busybox.net/pipermail/busybox/attachments/20060803/49fb798a/attachment-0001.htm 


More information about the busybox mailing list