aboutsummaryrefslogtreecommitdiff
path: root/networking/inetd.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-07-28 07:40:39 +0000
committerEric Andersen <andersen@codepoet.org>2003-07-28 07:40:39 +0000
commit35e643b39f6cc77b702c714cfa8e70f1e10601a9 (patch)
treead6b608081a4dde117563a1f1e9a6e3892a8752c /networking/inetd.c
parent4f4631732cab5886105d8809d4e9b17711def65b (diff)
downloadbusybox-35e643b39f6cc77b702c714cfa8e70f1e10601a9.tar.gz
last_patch95 from vodz:
Hi. Last patch have new libbb function vfork_rexec() for can use daemon() to uClinux system. This patched daemons: syslog, klogd, inetd, crond. This not tested! I havn`t this systems. Also. Previous patch for feature request MD5 crypt password for httpd don`t sended to this mailist on 07/15/03 (mailist have Pytom module problem?). The previous patch included, and have testing. --w vodz
Diffstat (limited to 'networking/inetd.c')
-rw-r--r--networking/inetd.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/networking/inetd.c b/networking/inetd.c
index 33b97ba94..af262c39c 100644
--- a/networking/inetd.c
+++ b/networking/inetd.c
@@ -806,7 +806,9 @@ inetd_main(int argc, char *argv[])
struct passwd *pwd;
struct group *grp = NULL;
struct sigaction sa;
- int ch, pid;
+ int pid;
+ unsigned long opt;
+ char *sq;
gid_t gid;
#ifdef INETD_UNSUPPORT_BILTIN
@@ -828,14 +830,21 @@ inetd_main(int argc, char *argv[])
LastArg = environ[-1] + strlen(environ[-1]);
#endif
- while ((ch = getopt(argc, argv, "q:")) != EOF)
- switch(ch) {
- case 'q':
+#if defined(__uClinux__)
+ opt = bb_getopt_ulflags(argc, argv, "q:f", &sq);
+ if (!(opt & 4)) {
+ daemon(0, 0);
+ /* reexec for vfork() do continue parent */
+ vfork_daemon_rexec(argc, argv, "-f");
+ }
+#else
+ opt = bb_getopt_ulflags(ac, av, "q:", &sq);
+ daemon(0, 0);
+#endif /* uClinux */
+
+ if(opt & 1) {
global_queuelen = atoi(optarg);
if (global_queuelen < 8) global_queuelen=8;
- break;
- default:
- bb_show_usage(); // "[-q len] [conf]"
}
argc -= optind;
argv += optind;
@@ -843,7 +852,6 @@ inetd_main(int argc, char *argv[])
if (argc > 0)
CONFIG = argv[0];
- daemon(0, 0);
openlog(bb_applet_name, LOG_PID | LOG_NOWAIT, LOG_DAEMON);
{
FILE *fp;