From 003d4ba15be5f43eb868cf89e8c8c7db46e9dc94 Mon Sep 17 00:00:00 2001 From: Christian Ruppert Date: Tue, 5 Jul 2011 00:51:29 +0200 Subject: Don't write into optarg, this also fixes a compiler warning. --- src/rc/runscript.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/rc/runscript.c') diff --git a/src/rc/runscript.c b/src/rc/runscript.c index a6a8d0e..f62e8dc 100644 --- a/src/rc/runscript.c +++ b/src/rc/runscript.c @@ -1333,12 +1333,6 @@ runscript(int argc, char **argv) prefix = NULL; retval = svc_exec("status", NULL); } else { - if (strcmp(optarg, "pause") == 0) { - ewarn("WARNING: 'pause' is deprecated; please use '--nodeps stop'"); - deps = false; - optarg = "stop"; - } - if (strcmp(optarg, "conditionalrestart") == 0 || strcmp(optarg, "condrestart") == 0) { @@ -1349,7 +1343,11 @@ runscript(int argc, char **argv) svc_restart(); } else if (strcmp(optarg, "start") == 0) { svc_start(); - } else if (strcmp(optarg, "stop") == 0) { + } else if (strcmp(optarg, "stop") == 0 || strcmp(optarg, "pause") == 0) { + if (strcmp(optarg, "pause") == 0) { + ewarn("WARNING: 'pause' is deprecated; please use '--nodeps stop'"); + deps = false; + } if (deps && in_background) get_started_services(); svc_stop(); -- cgit v1.2.3