aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-10-30 16:26:05 +0000
committerRoy Marples <roy@marples.name>2008-10-30 16:26:05 +0000
commite1341e372bac3352035892a2931458faf98c38a0 (patch)
treef568a2090c4e14151d646d98624a919c74e7419d
parent1c73f2967ca802c442824672eb3e31c19826fc4e (diff)
Fix --name when stopping, Gentoo #243088.
-rw-r--r--src/rc/start-stop-daemon.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/rc/start-stop-daemon.c b/src/rc/start-stop-daemon.c
index de5bd1dc..fd281a1d 100644
--- a/src/rc/start-stop-daemon.c
+++ b/src/rc/start-stop-daemon.c
@@ -371,7 +371,7 @@ static int run_stop_schedule(const char *exec, const char *const *argv,
if (verbose) {
if (exec)
- einfo ("Will stop %s\n", exec);
+ einfo ("Will stop %s", exec);
if (pidfile)
einfo("Will stop PID in pidfile `%s'", pidfile);
if (uid)
@@ -781,14 +781,15 @@ int start_stop_daemon(int argc, char **argv)
if (!exec) {
exec = *argv;
- if (name)
+ if (!exec)
+ exec = name;
+ if (name && start)
*argv = name;
- } else if (name)
+ } else if (name && (start || **argv))
*--argv = name;
else
*--argv = exec;
-
if (start && !exec)
eerrorx("%s: nothing to start", applet);