From c418d482baf414ef3f08a95ab99da7091f358b89 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Wed, 31 May 2006 10:19:51 +0000 Subject: [PATCH] - 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(). --- include/libbb.h | 2 +- libbb/vfork_daemon_rexec.c | 4 ++-- miscutils/crond.c | 6 +++--- networking/dnsd.c | 8 ++++---- networking/inetd.c | 6 +++--- sysklogd/klogd.c | 6 +++--- sysklogd/syslogd.c | 6 +++--- 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 extern void print_login_issue(const char *issue_file, const char *tty); extern void print_login_prompt(void); -#if defined(__uClinux__) +#ifdef BB_NOMMU extern void vfork_daemon_rexec(int nochdir, int noclose, int argc, char **argv, char *foreground_opt); #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 @@ #include "libbb.h" -#if defined(__uClinux__) +#ifdef BB_NOMMU void vfork_daemon_rexec(int nochdir, int noclose, int argc, char **argv, char *foreground_opt) { @@ -64,4 +64,4 @@ void vfork_daemon_rexec(int nochdir, int noclose, exit(0); } } -#endif /* uClinux */ +#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) */ if (!(opt & 4)) { -#if defined(__uClinux__) +#ifdef BB_NOMMU /* reexec for vfork() do continue parent */ vfork_daemon_rexec(1, 0, ac, av, "-f"); -#else /* uClinux */ +#else bb_xdaemon(1, 0); -#endif /* uClinux */ +#endif } (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) } /* - * Insert length of substrings insetad of dots + * Insert length of substrings instead of dots */ static void undot(uint8_t * rip) { @@ -393,12 +393,12 @@ int dnsd_main(int argc, char **argv) } if(is_daemon()) -#if defined(__uClinux__) +#ifdef BB_NOMMU /* reexec for vfork() do continue parent */ vfork_daemon_rexec(1, 0, argc, argv, "-d"); -#else /* uClinux */ +#else bb_xdaemon(1, 0); -#endif /* uClinuvx */ +#endif dnsentryinit(is_verbose()); 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[]) bb_error_msg_and_die ("non-root must specify a config file"); if (!(opt & 2)) { -#if defined(__uClinux__) +#ifdef BB_NOMMU /* reexec for vfork() do continue parent */ vfork_daemon_rexec (0, 0, argc, argv, "-f"); #else - daemon (0, 0); /* bb_xdaemon? */ -#endif /* uClinux */ + bb_xdaemon (0, 0); +#endif } else { setsid (); } 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) } if (!(opt & OPT_FOREGROUND)) { -#if defined(__uClinux__) +#ifdef BB_NOMMU vfork_daemon_rexec(0, 1, argc, argv, "-n"); -#else /* __uClinux__ */ +#else bb_xdaemon(0, 1); -#endif /* __uClinux__ */ +#endif } doKlogd(console_log_level); 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) umask(0); if (doFork == TRUE) { -#if defined(__uClinux__) +#ifdef BB_NOMMU vfork_daemon_rexec(0, 1, argc, argv, "-n"); -#else /* __uClinux__ */ +#else bb_xdaemon(0, 1); -#endif /* __uClinux__ */ +#endif } doSyslogd();