diff options
author | Guillem Jover <guillem@debian.org> | 2008-01-16 08:12:20 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2008-01-16 09:15:04 +0200 |
commit | 7a1da85bed792442adfd74c66bf9bd369ce4c4e6 (patch) | |
tree | 2c2d6972b5ec6f86e4402c1deff9c70fd53a46c9 /utils | |
parent | b6a8bc8f16e208e47416102ccdb67149bb4ddc1b (diff) | |
download | dpkg-7a1da85bed792442adfd74c66bf9bd369ce4c4e6.tar.gz |
s-s-d: Make --quiet silence --test
Closes: #367998
Diffstat (limited to 'utils')
-rw-r--r-- | utils/start-stop-daemon.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c index 24537d910..a74f7c740 100644 --- a/utils/start-stop-daemon.c +++ b/utils/start-stop-daemon.c @@ -1078,8 +1078,9 @@ do_stop(int signal_nr, int quietmode, int *n_killed, int *n_notkilled, int retry for (p = found; p; p = p->next) { if (testmode) { - printf("Would send signal %d to %d.\n", - signal_nr, p->pid); + if (quietmode <= 0) + printf("Would send signal %d to %d.\n", + signal_nr, p->pid); (*n_killed)++; } else if (kill(p->pid, signal_nr) == 0) { push(&killed, p->pid); @@ -1117,7 +1118,8 @@ run_stop_schedule(void) if (testmode) { if (schedule != NULL) { - printf("Ignoring --retry in test mode\n"); + if (quietmode <= 0) + printf("Ignoring --retry in test mode\n"); schedule = NULL; } } @@ -1318,7 +1320,7 @@ main(int argc, char **argv) printf("%s already running.\n", execname ? execname : "process"); exit(exitnodo); } - if (testmode) { + if (testmode && quietmode <= 0) { printf("Would start %s ", startas); while (argc-- > 0) printf("%s ", *argv++); @@ -1334,8 +1336,9 @@ main(int argc, char **argv) if (nicelevel) printf(", and add %i to the priority", nicelevel); printf(".\n"); - exit(0); } + if (testmode) + exit(0); if (quietmode < 0) printf("Starting %s...\n", startas); *--argv = startas; |