svn commit: trunk/busybox/networking

vda at busybox.net vda at busybox.net
Wed Mar 7 22:16:39 UTC 2007


Author: vda
Date: 2007-03-07 14:16:38 -0800 (Wed, 07 Mar 2007)
New Revision: 18026

Log:
httpd: make httpd usable for NOMMU CPUs


Modified:
   trunk/busybox/networking/httpd.c


Changeset:
Modified: trunk/busybox/networking/httpd.c
===================================================================
--- trunk/busybox/networking/httpd.c	2007-03-07 22:02:23 UTC (rev 18025)
+++ trunk/busybox/networking/httpd.c	2007-03-07 22:16:38 UTC (rev 18026)
@@ -977,7 +977,20 @@
 	if (pipe(toCgi) != 0)
 		return 0;
 
+/*
+ * Note: We can use vfork() here in the no-mmu case, although
+ * the child modifies the parent's variables, due to:
+ * 1) The parent does not use the child-modified variables.
+ * 2) The allocated memory (in the child) is freed when the process
+ *    exits. This happens instantly after the child finishes,
+ *    since httpd is run from inetd (and it can't run standalone
+ *    in uClinux).
+ */
+#ifdef BB_NOMMU
+	pid = vfork();
+#else
 	pid = fork();
+#endif
 	if (pid < 0)
 		return 0;
 




More information about the busybox-cvs mailing list