From a1fece2c70898a1180f0506df6695e3077510731 Mon Sep 17 00:00:00 2001 From: Russ Dill Date: Mon, 15 Dec 2003 21:57:44 +0000 Subject: Get vfork_daemon_rexec working under uclinux --- sysklogd/klogd.c | 7 ++++--- sysklogd/syslogd.c | 9 +++++---- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'sysklogd') diff --git a/sysklogd/klogd.c b/sysklogd/klogd.c index c132e065c..df3a668dd 100644 --- a/sysklogd/klogd.c +++ b/sysklogd/klogd.c @@ -147,11 +147,12 @@ extern int klogd_main(int argc, char **argv) } if (doFork) { +#if defined(__uClinux__) + vfork_daemon_rexec(0, 1, argc, argv, "-n"); +#else /* __uClinux__ */ if (daemon(0, 1) < 0) bb_perror_msg_and_die("daemon"); -#if defined(__uClinux__) - vfork_daemon_rexec(argc, argv, "-n"); -#endif +#endif /* __uClinux__ */ } doKlogd(console_log_level); diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c index 74b242c42..622500e48 100644 --- a/sysklogd/syslogd.c +++ b/sysklogd/syslogd.c @@ -681,11 +681,12 @@ extern int syslogd_main(int argc, char **argv) umask(0); if (doFork == TRUE) { - if(daemon(0, 1) < 0) - bb_perror_msg_and_die("daemon"); #if defined(__uClinux__) - vfork_daemon_rexec(argc, argv, "-n"); -#endif + vfork_daemon_rexec(0, 1, argc, argv, "-n"); +#else /* __uClinux__ */ + if(daemon(0, 1) < 0) + bb_perror_msg_and_die("daemon"); +#endif /* __uClinux__ */ } doSyslogd(); -- cgit v1.2.3