summaryrefslogtreecommitdiff
path: root/utils/start-stop-daemon.c
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2016-05-30 20:02:38 +0200
committerGuillem Jover <guillem@debian.org>2016-07-03 21:02:18 +0200
commit58811966a6b2e6879d29bc438497743668a4442d (patch)
treee7a36454feef3346f495e5f7525ef616eb3976d2 /utils/start-stop-daemon.c
parent3bda1e34afefcd5ebd20bde16bdfb9239c433090 (diff)
downloaddpkg-58811966a6b2e6879d29bc438497743668a4442d.tar.gz
s-s-d: Switch do_start() to return a value instead of exit()ing directly
Diffstat (limited to 'utils/start-stop-daemon.c')
-rw-r--r--utils/start-stop-daemon.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c
index 7ff30eacd..c04811a69 100644
--- a/utils/start-stop-daemon.c
+++ b/utils/start-stop-daemon.c
@@ -2003,7 +2003,7 @@ do_findprocs(void)
return do_procinit();
}
-static void
+static int
do_start(int argc, char **argv)
{
int devnull_fd = -1;
@@ -2015,7 +2015,7 @@ do_start(int argc, char **argv)
if (found) {
if (quietmode <= 0)
printf("%s already running.\n", execname ? execname : "process");
- exit(exitnodo);
+ return exitnodo;
}
if (testmode && quietmode <= 0) {
printf("Would start %s ", startas);
@@ -2041,7 +2041,7 @@ do_start(int argc, char **argv)
printf(".\n");
}
if (testmode)
- exit(0);
+ return 0;
if (quietmode < 0)
printf("Starting %s...\n", startas);
*--argv = startas;
@@ -2345,7 +2345,7 @@ main(int argc, char **argv)
argv += optind;
if (action == ACTION_START)
- do_start(argc, argv);
+ return do_start(argc, argv);
if (action == ACTION_STOP) {
int i = run_stop_schedule();