summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGerrit Pape <pape@smarden.org>2009-09-24 21:20:13 +0000
committerGerrit Pape <pape@smarden.org>2009-09-24 22:06:27 +0000
commit189d39c0b60a49d32b38d91ca94700de0fabbb99 (patch)
treea57bb60a8bbc8858e066e11a5b0aade8123f1f38 /src
parentf1069d3986eb3fbb4e9945ec669566efe5cb5cd7 (diff)
downloadrunit-189d39c0b60a49d32b38d91ca94700de0fabbb99.tar.gz
runit-189d39c0b60a49d32b38d91ca94700de0fabbb99.tar.xz
runit-189d39c0b60a49d32b38d91ca94700de0fabbb99.zip
* sv.c: fix exit code of status command in lsb mode (thx Mathieu
    Poumeyrol)
Diffstat (limited to 'src')
-rw-r--r--src/sv.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/sv.c b/src/sv.c
index 8269ca7..0db0b1e 100644
--- a/src/sv.c
+++ b/src/sv.c
@@ -150,9 +150,11 @@ unsigned int svstatus_print(char *m) {
   return(pid ? 1 : 2);
 }
 int status(char *unused) {
-  r =svstatus_get();
+  int rc;
+
+  rc =svstatus_get();
   switch(r) { case -1: if (lsb) done(4); case 0: return(0); }
-  r =svstatus_print(*service);
+  rc =svstatus_print(*service);
   if (chdir("log") == -1) {
     if (errno != error_noent) {
       outs("; log: "); outs(WARN);
@@ -165,8 +167,8 @@ int status(char *unused) {
       outs("; "); svstatus_print("log");
     }
   flush("\n");
-  if (lsb) switch(r) { case 1: done(0); case 2: done(3); case 0: done(4); }
-  return(r);
+  if (lsb) switch(rc) { case 1: done(0); case 2: done(3); case 0: done(4); }
+  return(rc);
 }
 
 int checkscript() {