diff options
Diffstat (limited to 'networking/inetd.c')
-rw-r--r-- | networking/inetd.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/networking/inetd.c b/networking/inetd.c index 83123463f..4faa4203a 100644 --- a/networking/inetd.c +++ b/networking/inetd.c | |||
@@ -1274,30 +1274,24 @@ int inetd_main(int argc, char *argv[]) | |||
1274 | LastArg = envp[-1] + strlen(envp[-1]); | 1274 | LastArg = envp[-1] + strlen(envp[-1]); |
1275 | #endif | 1275 | #endif |
1276 | 1276 | ||
1277 | opt = getopt32(argc, argv, "R:f", &stoomany); | ||
1278 | if(opt & 1) { | ||
1279 | toomany = xatoi_u(stoomany); | ||
1280 | } | ||
1281 | argc -= optind; | ||
1282 | argv += optind; | ||
1283 | |||
1284 | uid = getuid(); | 1277 | uid = getuid(); |
1285 | if (uid != 0) | 1278 | if (uid != 0) |
1286 | config_filename = NULL; | 1279 | config_filename = NULL; |
1287 | if (argc > 0) | 1280 | |
1281 | opt = getopt32(argc, argv, "R:f", &stoomany); | ||
1282 | if (opt & 1) | ||
1283 | toomany = xatoi_u(stoomany); | ||
1284 | argv += optind; | ||
1285 | argc -= optind; | ||
1286 | if (argc) | ||
1288 | config_filename = argv[0]; | 1287 | config_filename = argv[0]; |
1289 | if (config_filename == NULL) | 1288 | if (config_filename == NULL) |
1290 | bb_error_msg_and_die("non-root must specify a config file"); | 1289 | bb_error_msg_and_die("non-root must specify a config file"); |
1291 | 1290 | ||
1292 | #ifdef BB_NOMMU | 1291 | if (!(opt & 2)) |
1293 | if (!(opt & 2)) { | 1292 | bb_daemonize_or_rexec(0, argv - optind); |
1294 | if (!re_execed) | 1293 | else |
1295 | vfork_daemon_rexec(0, 0, argv); | 1294 | bb_sanitize_stdio(); |
1296 | } | ||
1297 | bb_sanitize_stdio(); | ||
1298 | #else | ||
1299 | bb_sanitize_stdio_maybe_daemonize(!(opt & 2)); | ||
1300 | #endif | ||
1301 | openlog(applet_name, LOG_PID | LOG_NOWAIT, LOG_DAEMON); | 1295 | openlog(applet_name, LOG_PID | LOG_NOWAIT, LOG_DAEMON); |
1302 | logmode = LOGMODE_SYSLOG; | 1296 | logmode = LOGMODE_SYSLOG; |
1303 | 1297 | ||