aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-12-14 23:00:29 +0000
committerRoy Marples <roy@marples.name>2007-12-14 23:00:29 +0000
commit10edca8e0e16c3a5e927e80c4cfd1a06c0b76e76 (patch)
treead527b1196b92041e84baa2544b83c9dda28f6cd
parentafdcf1fa158e9833c163068f77e88d21ba0e3225 (diff)
Only assume the current runlevel if none specified
-rw-r--r--src/rc-update.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/rc-update.c b/src/rc-update.c
index e39db593..7c611d3c 100644
--- a/src/rc-update.c
+++ b/src/rc-update.c
@@ -241,16 +241,15 @@ int rc_update (int argc, char **argv)
if (action & DOADD) {
actfunc = add;
- if (! runlevels)
- rc_strlist_add (&runlevels, rc_runlevel_get ());
} else if (action & DODELETE) {
actfunc = delete;
- if (! runlevels)
- runlevels = rc_runlevel_list ();
} else
eerrorx ("%s: invalid action", applet);
if (! runlevels)
+ rc_strlist_add (&runlevels, rc_runlevel_get ());
+
+ if (! runlevels)
eerrorx ("%s: no runlevels found", applet);
STRLIST_FOREACH (runlevels, runlevel, i) {