From 0963e067664119c6ae352167698e1fc8fc8f02d5 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Fri, 17 Aug 2007 13:23:43 +0000 Subject: Mark the right service as failed and only output a new line if we outputted anything at all for /etc/init.d/foo needsme --- src/runscript.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/runscript.c b/src/runscript.c index 1bab5690..6a2c4079 100644 --- a/src/runscript.c +++ b/src/runscript.c @@ -887,7 +887,7 @@ static void svc_stop (bool deps) strcmp (softlevel, RC_LEVEL_REBOOT) == 0 || strcmp (softlevel, RC_LEVEL_SINGLE) == 0)) continue; - rc_mark_service (svc, rc_service_failed); + rc_mark_service (service, rc_service_failed); } eerrorx ("ERROR: cannot stop %s as %s is still up", @@ -1216,7 +1216,8 @@ int runscript (int argc, char **argv) softlevel, depoptions); STRLIST_FOREACH (services, svc, i) printf ("%s%s", i == 1 ? "" : " ", svc); - printf ("\n"); + if (services) + printf ("\n"); } else if (strcmp (optarg, "status") == 0) { rc_service_state_t r = svc_status (service); retval = (int) r; -- cgit v1.2.3