- s/defined(__uClinux__)/BB_NOMMU/
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Wed, 31 May 2006 10:19:51 +0000 (10:19 -0000)
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Wed, 31 May 2006 10:19:51 +0000 (10:19 -0000)
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
libbb/vfork_daemon_rexec.c
miscutils/crond.c
networking/dnsd.c
networking/inetd.c
sysklogd/klogd.c
sysklogd/syslogd.c

index 5f2309a2545e5a79845b1a5e457672e6620ebe36..e4be35d48c5963773b846e6e871693fd501db614 100644 (file)
@@ -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
index ffd9dc15e933376bc116667303f883d049874ed2..59a2287b023d20cc076acabcdfdd7489cb884665 100644 (file)
@@ -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 */
index 030e962f33b891730445670489a07aba7cf3784b..954d97965ff2c5bd70336ca87e490d04bed9423f 100644 (file)
@@ -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 */
index 58a8fc1d2fe2a80ff59d5acc6b6fc9c10cddd013..f8bd07e1088218c211da959e653f9254d42e0cba 100644 (file)
@@ -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());
 
index 3ecd322921b2c6b1cc6006306fbcccf6153a7054..b9ff4de4dd5841f168b39410df56c9fa5add9943 100644 (file)
@@ -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 ();
   }
index 95a35c25e7adf726e93be36bdee398c2253d7a0c..cd152a57070c270c39ee5f22f72356c705571268 100644 (file)
@@ -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);
 
index deaee49c2237c854abae5b229315ae344d8d33e9..2e2681b6708c08ae93c58b40b6865a313c36599b 100644 (file)
@@ -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();