aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-05-31 10:19:51 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-05-31 10:19:51 +0000
commitc418d482baf414ef3f08a95ab99da7091f358b89 (patch)
tree4bcf7032041b501464f38ff9715f98453bebcbaf
parent507cd755a44628ced60acfa568b402cdf2f5547b (diff)
downloadbusybox-w32-c418d482baf414ef3f08a95ab99da7091f358b89.tar.gz
busybox-w32-c418d482baf414ef3f08a95ab99da7091f358b89.tar.bz2
busybox-w32-c418d482baf414ef3f08a95ab99da7091f358b89.zip
- s/defined(__uClinux__)/BB_NOMMU/
This needs a second pass to: + add bb_daemon(unsigned char no_chdir, unsigned char no_close, const char*flag) + eventually globally export argc and argv, so we don't need to pass it to bb_daemon().
-rw-r--r--include/libbb.h2
-rw-r--r--libbb/vfork_daemon_rexec.c4
-rw-r--r--miscutils/crond.c6
-rw-r--r--networking/dnsd.c8
-rw-r--r--networking/inetd.c6
-rw-r--r--sysklogd/klogd.c6
-rw-r--r--sysklogd/syslogd.c6
7 files changed, 19 insertions, 19 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 5f2309a25..e4be35d48 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -492,7 +492,7 @@ extern int my_query_module(const char *name, int which, void **buf, size_t *bufs
492extern void print_login_issue(const char *issue_file, const char *tty); 492extern void print_login_issue(const char *issue_file, const char *tty);
493extern void print_login_prompt(void); 493extern void print_login_prompt(void);
494 494
495#if defined(__uClinux__) 495#ifdef BB_NOMMU
496extern void vfork_daemon_rexec(int nochdir, int noclose, 496extern void vfork_daemon_rexec(int nochdir, int noclose,
497 int argc, char **argv, char *foreground_opt); 497 int argc, char **argv, char *foreground_opt);
498#endif 498#endif
diff --git a/libbb/vfork_daemon_rexec.c b/libbb/vfork_daemon_rexec.c
index ffd9dc15e..59a2287b0 100644
--- a/libbb/vfork_daemon_rexec.c
+++ b/libbb/vfork_daemon_rexec.c
@@ -22,7 +22,7 @@
22#include "libbb.h" 22#include "libbb.h"
23 23
24 24
25#if defined(__uClinux__) 25#ifdef BB_NOMMU
26void vfork_daemon_rexec(int nochdir, int noclose, 26void vfork_daemon_rexec(int nochdir, int noclose,
27 int argc, char **argv, char *foreground_opt) 27 int argc, char **argv, char *foreground_opt)
28{ 28{
@@ -64,4 +64,4 @@ void vfork_daemon_rexec(int nochdir, int noclose,
64 exit(0); 64 exit(0);
65 } 65 }
66} 66}
67#endif /* uClinux */ 67#endif /* BB_NOMMU */
diff --git a/miscutils/crond.c b/miscutils/crond.c
index 030e962f3..954d97965 100644
--- a/miscutils/crond.c
+++ b/miscutils/crond.c
@@ -205,12 +205,12 @@ int crond_main(int ac, char **av)
205 */ 205 */
206 206
207 if (!(opt & 4)) { 207 if (!(opt & 4)) {
208#if defined(__uClinux__) 208#ifdef BB_NOMMU
209 /* reexec for vfork() do continue parent */ 209 /* reexec for vfork() do continue parent */
210 vfork_daemon_rexec(1, 0, ac, av, "-f"); 210 vfork_daemon_rexec(1, 0, ac, av, "-f");
211#else /* uClinux */ 211#else
212 bb_xdaemon(1, 0); 212 bb_xdaemon(1, 0);
213#endif /* uClinux */ 213#endif
214 } 214 }
215 215
216 (void) startlogger(); /* need if syslog mode selected */ 216 (void) startlogger(); /* need if syslog mode selected */
diff --git a/networking/dnsd.c b/networking/dnsd.c
index 58a8fc1d2..f8bd07e10 100644
--- a/networking/dnsd.c
+++ b/networking/dnsd.c
@@ -92,7 +92,7 @@ static void convname(char *a, uint8_t *q)
92} 92}
93 93
94/* 94/*
95 * Insert length of substrings insetad of dots 95 * Insert length of substrings instead of dots
96 */ 96 */
97static void undot(uint8_t * rip) 97static void undot(uint8_t * rip)
98{ 98{
@@ -393,12 +393,12 @@ int dnsd_main(int argc, char **argv)
393 } 393 }
394 394
395 if(is_daemon()) 395 if(is_daemon())
396#if defined(__uClinux__) 396#ifdef BB_NOMMU
397 /* reexec for vfork() do continue parent */ 397 /* reexec for vfork() do continue parent */
398 vfork_daemon_rexec(1, 0, argc, argv, "-d"); 398 vfork_daemon_rexec(1, 0, argc, argv, "-d");
399#else /* uClinux */ 399#else
400 bb_xdaemon(1, 0); 400 bb_xdaemon(1, 0);
401#endif /* uClinuvx */ 401#endif
402 402
403 dnsentryinit(is_verbose()); 403 dnsentryinit(is_verbose());
404 404
diff --git a/networking/inetd.c b/networking/inetd.c
index 3ecd32292..b9ff4de4d 100644
--- a/networking/inetd.c
+++ b/networking/inetd.c
@@ -1309,12 +1309,12 @@ inetd_main (int argc, char *argv[])
1309 bb_error_msg_and_die ("non-root must specify a config file"); 1309 bb_error_msg_and_die ("non-root must specify a config file");
1310 1310
1311 if (!(opt & 2)) { 1311 if (!(opt & 2)) {
1312#if defined(__uClinux__) 1312#ifdef BB_NOMMU
1313 /* reexec for vfork() do continue parent */ 1313 /* reexec for vfork() do continue parent */
1314 vfork_daemon_rexec (0, 0, argc, argv, "-f"); 1314 vfork_daemon_rexec (0, 0, argc, argv, "-f");
1315#else 1315#else
1316 daemon (0, 0); /* bb_xdaemon? */ 1316 bb_xdaemon (0, 0);
1317#endif /* uClinux */ 1317#endif
1318 } else { 1318 } else {
1319 setsid (); 1319 setsid ();
1320 } 1320 }
diff --git a/sysklogd/klogd.c b/sysklogd/klogd.c
index 95a35c25e..cd152a570 100644
--- a/sysklogd/klogd.c
+++ b/sysklogd/klogd.c
@@ -118,11 +118,11 @@ int klogd_main(int argc, char **argv)
118 } 118 }
119 119
120 if (!(opt & OPT_FOREGROUND)) { 120 if (!(opt & OPT_FOREGROUND)) {
121#if defined(__uClinux__) 121#ifdef BB_NOMMU
122 vfork_daemon_rexec(0, 1, argc, argv, "-n"); 122 vfork_daemon_rexec(0, 1, argc, argv, "-n");
123#else /* __uClinux__ */ 123#else
124 bb_xdaemon(0, 1); 124 bb_xdaemon(0, 1);
125#endif /* __uClinux__ */ 125#endif
126 } 126 }
127 doKlogd(console_log_level); 127 doKlogd(console_log_level);
128 128
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index deaee49c2..2e2681b67 100644
--- a/sysklogd/syslogd.c
+++ b/sysklogd/syslogd.c
@@ -670,11 +670,11 @@ int syslogd_main(int argc, char **argv)
670 umask(0); 670 umask(0);
671 671
672 if (doFork == TRUE) { 672 if (doFork == TRUE) {
673#if defined(__uClinux__) 673#ifdef BB_NOMMU
674 vfork_daemon_rexec(0, 1, argc, argv, "-n"); 674 vfork_daemon_rexec(0, 1, argc, argv, "-n");
675#else /* __uClinux__ */ 675#else
676 bb_xdaemon(0, 1); 676 bb_xdaemon(0, 1);
677#endif /* __uClinux__ */ 677#endif
678 } 678 }
679 doSyslogd(); 679 doSyslogd();
680 680