diff options
author | Gerrit Pape <pape@smarden.org> | 2009-09-24 21:20:13 +0000 |
---|---|---|
committer | Gerrit Pape <pape@smarden.org> | 2009-09-24 22:06:27 +0000 |
commit | 189d39c0b60a49d32b38d91ca94700de0fabbb99 (patch) | |
tree | a57bb60a8bbc8858e066e11a5b0aade8123f1f38 | |
parent | f1069d3986eb3fbb4e9945ec669566efe5cb5cd7 (diff) | |
download | runit-189d39c0b60a49d32b38d91ca94700de0fabbb99.tar.gz runit-189d39c0b60a49d32b38d91ca94700de0fabbb99.tar.xz runit-189d39c0b60a49d32b38d91ca94700de0fabbb99.zip |
* sv.c: fix exit code of status command in lsb mode (thx Mathieu
Poumeyrol)
-rw-r--r-- | package/CHANGES | 2 | ||||
-rw-r--r-- | src/sv.c | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/package/CHANGES b/package/CHANGES index 4a21614..84f120f 100644 --- a/package/CHANGES +++ b/package/CHANGES @@ -2,6 +2,8 @@ * pathexec_env.c, pathexec.h: add function pathexec_env_run(). * chpst.c, man/chpst.8: new option -b argv0: run prog with different 0th argument. + * sv.c: fix exit code of status command in lsb mode (thx Mathieu + Poumeyrol) 2.0.0 Sun, 15 Jun 2008 15:31:05 +0000 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() { |