runit

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 966addf718a51eb34e27ac4e20c26ba7fef18b9c
parent 2b7bef14e50f69b0d9b811ddf65b6bf626f01577
Author: Gerrit Pape <pape@smarden.org>
Date:   Thu, 24 Sep 2009 21:20:13 +0000

  * sv.c: fix exit code of status command in lsb mode (thx Mathieu
    Poumeyrol)

Diffstat:
Mpackage/CHANGES | 2++
Msrc/sv.c | 10++++++----
2 files changed, 8 insertions(+), 4 deletions(-)

diff --git 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 @@ -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() {