summaryrefslogtreecommitdiff
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-w32-35e643b39f6cc77b702c714cfa8e70f1e10601a9.tar.gz
busybox-w32-35e643b39f6cc77b702c714cfa8e70f1e10601a9.tar.bz2
busybox-w32-35e643b39f6cc77b702c714cfa8e70f1e10601a9.zip
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[])
806 struct passwd *pwd; 806 struct passwd *pwd;
807 struct group *grp = NULL; 807 struct group *grp = NULL;
808 struct sigaction sa; 808 struct sigaction sa;
809 int ch, pid; 809 int pid;
810 unsigned long opt;
811 char *sq;
810 gid_t gid; 812 gid_t gid;
811 813
812#ifdef INETD_UNSUPPORT_BILTIN 814#ifdef INETD_UNSUPPORT_BILTIN
@@ -828,14 +830,21 @@ inetd_main(int argc, char *argv[])
828 LastArg = environ[-1] + strlen(environ[-1]); 830 LastArg = environ[-1] + strlen(environ[-1]);
829#endif 831#endif
830 832
831 while ((ch = getopt(argc, argv, "q:")) != EOF) 833#if defined(__uClinux__)
832 switch(ch) { 834 opt = bb_getopt_ulflags(argc, argv, "q:f", &sq);
833 case 'q': 835 if (!(opt & 4)) {
836 daemon(0, 0);
837 /* reexec for vfork() do continue parent */
838 vfork_daemon_rexec(argc, argv, "-f");
839 }
840#else
841 opt = bb_getopt_ulflags(ac, av, "q:", &sq);
842 daemon(0, 0);
843#endif /* uClinux */
844
845 if(opt & 1) {
834 global_queuelen = atoi(optarg); 846 global_queuelen = atoi(optarg);
835 if (global_queuelen < 8) global_queuelen=8; 847 if (global_queuelen < 8) global_queuelen=8;
836 break;
837 default:
838 bb_show_usage(); // "[-q len] [conf]"
839 } 848 }
840 argc -= optind; 849 argc -= optind;
841 argv += optind; 850 argv += optind;
@@ -843,7 +852,6 @@ inetd_main(int argc, char *argv[])
843 if (argc > 0) 852 if (argc > 0)
844 CONFIG = argv[0]; 853 CONFIG = argv[0];
845 854
846 daemon(0, 0);
847 openlog(bb_applet_name, LOG_PID | LOG_NOWAIT, LOG_DAEMON); 855 openlog(bb_applet_name, LOG_PID | LOG_NOWAIT, LOG_DAEMON);
848 { 856 {
849 FILE *fp; 857 FILE *fp;