summaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorDenis Vlasenko2007-03-07 22:16:38 +0000
committerDenis Vlasenko2007-03-07 22:16:38 +0000
commit80281fefc032c3317d5709489aadb733f6fb0e30 (patch)
tree99da76ff0b7eb01650ea6516b74d6a2eb43a5290 /networking
parentab9eef21a57c23567505e8fbceb8e5ea76306ce1 (diff)
downloadbusybox-80281fefc032c3317d5709489aadb733f6fb0e30.zip
busybox-80281fefc032c3317d5709489aadb733f6fb0e30.tar.gz
httpd: make httpd usable for NOMMU CPUs
Diffstat (limited to 'networking')
-rw-r--r--networking/httpd.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/networking/httpd.c b/networking/httpd.c
index ee408eb..72b03de 100644
--- a/networking/httpd.c
+++ b/networking/httpd.c
@@ -977,7 +977,20 @@ static int sendCgi(const char *url,
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;