From 8f4824a32599c1f9b9776230f24d491671bc3537 Mon Sep 17 00:00:00 2001
From: landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>
Date: Thu, 3 Aug 2006 17:49:15 +0000
Subject: Attempt to fixup httpd.c to match svn 15767.

git-svn-id: svn://busybox.net/trunk/busybox@15768 69ca8d6d-28ef-0310-b511-8ec308f3f277
---
 networking/httpd.c | 25 ++++++-------------------
 1 file 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 @@
 */
 
 
-#include <stdio.h>
-#include <ctype.h>         /* for isspace           */
-#include <string.h>
-#include <stdlib.h>        /* for malloc            */
-#include <time.h>
-#include <unistd.h>        /* for close             */
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/socket.h>    /* for connect and socket*/
-#include <netinet/in.h>    /* for sockaddr_in       */
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <fcntl.h>         /* for open modes        */
 #include "busybox.h"
 
 
@@ -871,7 +858,7 @@ static int openServer(void)
   lsocket.sin_family = AF_INET;
   lsocket.sin_addr.s_addr = INADDR_ANY;
   lsocket.sin_port = htons(config->port);
-  fd = bb_xsocket(AF_INET, SOCK_STREAM, 0);
+  fd = 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. */
 #ifdef SO_REUSEPORT
@@ -879,8 +866,8 @@ static int openServer(void)
 #else
   setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (void *)&on, sizeof(on)) ;
 #endif
-  bb_xbind(fd, (struct sockaddr *)&lsocket, sizeof(lsocket));
-  listen(fd, 9); /* bb_xlisten? */
+  xbind(fd, (struct sockaddr *)&lsocket, sizeof(lsocket));
+  xlisten(fd, 9);
   signal(SIGCHLD, SIG_IGN);   /* prevent zombie (defunct) processes */
   return fd;
 }
@@ -1994,7 +1981,7 @@ int httpd_main(int argc, char *argv[])
 #endif
 #endif
 
-  bb_xchdir(home_httpd);
+  xchdir(home_httpd);
 #ifdef CONFIG_FEATURE_HTTPD_WITHOUT_INETD
   server = openServer();
 # ifdef CONFIG_FEATURE_HTTPD_SETUID
@@ -2008,7 +1995,7 @@ int httpd_main(int argc, char *argv[])
    {
 	char *p = getenv("PATH");
 	if(p) {
-		p = bb_xstrdup(p);
+		p = xstrdup(p);
 	}
 	clearenv();
 	if(p)
@@ -2027,7 +2014,7 @@ int httpd_main(int argc, char *argv[])
 
 #ifdef CONFIG_FEATURE_HTTPD_WITHOUT_INETD
 # if !DEBUG
-  bb_xdaemon(1, 0);     /* don`t change curent directory */
+  xdaemon(1, 0);     /* don`t change curent directory */
 # endif
   return miniHttpd(server);
 #else
-- 
cgit v1.2.3-55-g6feb