summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGerrit Pape <pape@smarden.org>2014-07-30 13:44:35 +0000
committerGerrit Pape <pape@smarden.org>2014-07-30 13:49:52 +0000
commitfea314879f34ebf1065ff3abfc9dc5e4ea746419 (patch)
treeab35c7ccd46b37399cfb2d2885426ded3cc928d4 /src
parent7cb4ff9d9f1b6fde9e25060eaef1e1d29a43a7cb (diff)
downloadrunit-fea314879f34ebf1065ff3abfc9dc5e4ea746419.tar.gz
runit-fea314879f34ebf1065ff3abfc9dc5e4ea746419.tar.xz
runit-fea314879f34ebf1065ff3abfc9dc5e4ea746419.zip
* sv.c: fix typo that may lead to wrong output from sv when reporting
    status of multiple service directories.

Thx Jamie Heilman, https://bugs.debian.org/715512:
> Given two service directories:
>
> # ls testapp1
> run  supervise
> # ls testapp2
> log  run  supervise
>
> where testapp1 is running, and testapp2 isn't:
>
> # sv status ./testapp1
> run: ./testapp1: (pid 3682) 408178s
> # sv status ./testapp2
> fail: ./testapp2: runsv not running
> # sv status ./testapp1 ./testapp2
> run: ./testapp1: (pid 3682) 408184s
> fail: ./testapp2: runsv not running
> run: ./testapp2: (pid 3682) 408184sfail: ./testapp2: runsv not running
Diffstat (limited to 'src')
-rw-r--r--src/sv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sv.c b/src/sv.c
index d126cee..06b2e41 100644
--- a/src/sv.c
+++ b/src/sv.c
@@ -153,7 +153,7 @@ int status(char *unused) {
   int rc;
 
   rc =svstatus_get();
-  switch(r) { case -1: if (lsb) done(4); case 0: return(0); }
+  switch(rc) { case -1: if (lsb) done(4); case 0: return(0); }
   rc =svstatus_print(*service);
   if (chdir("log") == -1) {
     if (errno != error_noent) {