aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-06-23 23:14:02 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-06-23 23:14:02 +0000
commit56258b688cc4fb2a5cfacb4e7a17fe51e158c101 (patch)
treeb82b6e99e6212de42e212959273ae90987536448
parent198badafd82905c9a2e76eeacb7ce463d8518bda (diff)
downloadbusybox-w32-56258b688cc4fb2a5cfacb4e7a17fe51e158c101.tar.gz
busybox-w32-56258b688cc4fb2a5cfacb4e7a17fe51e158c101.tar.bz2
busybox-w32-56258b688cc4fb2a5cfacb4e7a17fe51e158c101.zip
httpd: NOMMU fixes by Alex Landau <landau_alex@yahoo.com>
-rw-r--r--networking/httpd.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/networking/httpd.c b/networking/httpd.c
index 529f66bc4..8c0a83e52 100644
--- a/networking/httpd.c
+++ b/networking/httpd.c
@@ -841,6 +841,7 @@ static void decodeBase64(char *Data)
841 * $Errors: None 841 * $Errors: None
842 * 842 *
843 ****************************************************************************/ 843 ****************************************************************************/
844#if BB_MMU
844static int openServer(void) 845static int openServer(void)
845{ 846{
846 int fd; 847 int fd;
@@ -850,6 +851,7 @@ static int openServer(void)
850 xlisten(fd, 9); 851 xlisten(fd, 9);
851 return fd; 852 return fd;
852} 853}
854#endif
853 855
854/**************************************************************************** 856/****************************************************************************
855 * 857 *
@@ -1821,6 +1823,7 @@ static void handleIncoming(void)
1821 close(accepted_socket); 1823 close(accepted_socket);
1822} 1824}
1823 1825
1826#if BB_MMU
1824/**************************************************************************** 1827/****************************************************************************
1825 * 1828 *
1826 > $Function: miniHttpd() 1829 > $Function: miniHttpd()
@@ -1900,6 +1903,7 @@ static int miniHttpd(int server)
1900 } /* while (1) */ 1903 } /* while (1) */
1901 return 0; 1904 return 0;
1902} 1905}
1906#endif
1903 1907
1904/* from inetd */ 1908/* from inetd */
1905static int miniHttpd_inetd(void) 1909static int miniHttpd_inetd(void)
@@ -2033,6 +2037,7 @@ int httpd_main(int argc, char **argv)
2033 2037
2034 xchdir(home_httpd); 2038 xchdir(home_httpd);
2035 if (!(opt & OPT_INETD)) { 2039 if (!(opt & OPT_INETD)) {
2040#if BB_MMU
2036 signal(SIGCHLD, SIG_IGN); 2041 signal(SIGCHLD, SIG_IGN);
2037 server_socket = openServer(); 2042 server_socket = openServer();
2038#if ENABLE_FEATURE_HTTPD_SETUID 2043#if ENABLE_FEATURE_HTTPD_SETUID
@@ -2046,6 +2051,9 @@ int httpd_main(int argc, char **argv)
2046 xsetuid(ugid.uid); 2051 xsetuid(ugid.uid);
2047 } 2052 }
2048#endif 2053#endif
2054#else /* BB_MMU */
2055 bb_error_msg_and_die("-i is required");
2056#endif
2049 } 2057 }
2050 2058
2051#if ENABLE_FEATURE_HTTPD_CGI 2059#if ENABLE_FEATURE_HTTPD_CGI
@@ -2069,7 +2077,11 @@ int httpd_main(int argc, char **argv)
2069 if (opt & OPT_INETD) 2077 if (opt & OPT_INETD)
2070 return miniHttpd_inetd(); 2078 return miniHttpd_inetd();
2071 2079
2080#if BB_MMU
2072 if (!(opt & OPT_FOREGROUND)) 2081 if (!(opt & OPT_FOREGROUND))
2073 bb_daemonize(0); /* don't change current directory */ 2082 bb_daemonize(0); /* don't change current directory */
2074 return miniHttpd(server_socket); 2083 return miniHttpd(server_socket);
2084#else
2085 return 0; /* not reached */
2086#endif
2075} 2087}