aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-08-03 17:49:15 +0000
committerRob Landley <rob@landley.net>2006-08-03 17:49:15 +0000
commit280a264fb893670f00e333dc75c58b6c77970048 (patch)
tree6f5f1902884646e7240bc12b149275095ec5e25d
parentd921b2ecc0d294ad4bf8c7458fc52a60c28727d2 (diff)
downloadbusybox-w32-280a264fb893670f00e333dc75c58b6c77970048.tar.gz
busybox-w32-280a264fb893670f00e333dc75c58b6c77970048.tar.bz2
busybox-w32-280a264fb893670f00e333dc75c58b6c77970048.zip
Attempt to fixup httpd.c to match svn 15767.
-rw-r--r--networking/httpd.c25
1 files changed, 6 insertions, 19 deletions
diff --git a/networking/httpd.c b/networking/httpd.c
index 64d88f1cd..4e0ab92d5 100644
--- a/networking/httpd.c
+++ b/networking/httpd.c
@@ -89,19 +89,6 @@
89*/ 89*/
90 90
91 91
92#include <stdio.h>
93#include <ctype.h> /* for isspace */
94#include <string.h>
95#include <stdlib.h> /* for malloc */
96#include <time.h>
97#include <unistd.h> /* for close */
98#include <signal.h>
99#include <sys/types.h>
100#include <sys/socket.h> /* for connect and socket*/
101#include <netinet/in.h> /* for sockaddr_in */
102#include <sys/stat.h>
103#include <sys/wait.h>
104#include <fcntl.h> /* for open modes */
105#include "busybox.h" 92#include "busybox.h"
106 93
107 94
@@ -871,7 +858,7 @@ static int openServer(void)
871 lsocket.sin_family = AF_INET; 858 lsocket.sin_family = AF_INET;
872 lsocket.sin_addr.s_addr = INADDR_ANY; 859 lsocket.sin_addr.s_addr = INADDR_ANY;
873 lsocket.sin_port = htons(config->port); 860 lsocket.sin_port = htons(config->port);
874 fd = bb_xsocket(AF_INET, SOCK_STREAM, 0); 861 fd = xsocket(AF_INET, SOCK_STREAM, 0);
875 /* tell the OS it's OK to reuse a previous address even though */ 862 /* tell the OS it's OK to reuse a previous address even though */
876 /* it may still be in a close down state. Allows bind to succeed. */ 863 /* it may still be in a close down state. Allows bind to succeed. */
877#ifdef SO_REUSEPORT 864#ifdef SO_REUSEPORT
@@ -879,8 +866,8 @@ static int openServer(void)
879#else 866#else
880 setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (void *)&on, sizeof(on)) ; 867 setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (void *)&on, sizeof(on)) ;
881#endif 868#endif
882 bb_xbind(fd, (struct sockaddr *)&lsocket, sizeof(lsocket)); 869 xbind(fd, (struct sockaddr *)&lsocket, sizeof(lsocket));
883 listen(fd, 9); /* bb_xlisten? */ 870 xlisten(fd, 9);
884 signal(SIGCHLD, SIG_IGN); /* prevent zombie (defunct) processes */ 871 signal(SIGCHLD, SIG_IGN); /* prevent zombie (defunct) processes */
885 return fd; 872 return fd;
886} 873}
@@ -1994,7 +1981,7 @@ int httpd_main(int argc, char *argv[])
1994#endif 1981#endif
1995#endif 1982#endif
1996 1983
1997 bb_xchdir(home_httpd); 1984 xchdir(home_httpd);
1998#ifdef CONFIG_FEATURE_HTTPD_WITHOUT_INETD 1985#ifdef CONFIG_FEATURE_HTTPD_WITHOUT_INETD
1999 server = openServer(); 1986 server = openServer();
2000# ifdef CONFIG_FEATURE_HTTPD_SETUID 1987# ifdef CONFIG_FEATURE_HTTPD_SETUID
@@ -2008,7 +1995,7 @@ int httpd_main(int argc, char *argv[])
2008 { 1995 {
2009 char *p = getenv("PATH"); 1996 char *p = getenv("PATH");
2010 if(p) { 1997 if(p) {
2011 p = bb_xstrdup(p); 1998 p = xstrdup(p);
2012 } 1999 }
2013 clearenv(); 2000 clearenv();
2014 if(p) 2001 if(p)
@@ -2027,7 +2014,7 @@ int httpd_main(int argc, char *argv[])
2027 2014
2028#ifdef CONFIG_FEATURE_HTTPD_WITHOUT_INETD 2015#ifdef CONFIG_FEATURE_HTTPD_WITHOUT_INETD
2029# if !DEBUG 2016# if !DEBUG
2030 bb_xdaemon(1, 0); /* don`t change curent directory */ 2017 xdaemon(1, 0); /* don`t change curent directory */
2031# endif 2018# endif
2032 return miniHttpd(server); 2019 return miniHttpd(server);
2033#else 2020#else