diff options
author | Christian Ruppert <idl0r@gentoo.org> | 2011-07-05 00:51:29 +0200 |
---|---|---|
committer | Christian Ruppert <idl0r@gentoo.org> | 2011-07-05 00:51:29 +0200 |
commit | 003d4ba15be5f43eb868cf89e8c8c7db46e9dc94 (patch) | |
tree | 83e99dcc968a0b47d545cf6786d7c3388dcc628e | |
parent | 49f1a8702b49e4f1bf121bf22d4196e7199bacfa (diff) |
Don't write into optarg, this also fixes a compiler warning.
-rw-r--r-- | src/rc/runscript.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/rc/runscript.c b/src/rc/runscript.c index a6a8d0e0..f62e8dc9 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(); |