From e1341e372bac3352035892a2931458faf98c38a0 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Thu, 30 Oct 2008 16:26:05 +0000 Subject: Fix --name when stopping, Gentoo #243088. --- src/rc/start-stop-daemon.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') 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); -- cgit v1.2.3