summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGerrit Pape <pape@smarden.org>2009-10-04 20:20:57 +0000
committerGerrit Pape <pape@smarden.org>2009-10-04 20:20:57 +0000
commit5944840b7e27b9a732c20e5013a796eb092bf319 (patch)
treebd928943d2e38719efd5b35b89d630777c6cd36e /src
parentb1c3bb10fa8f5164e09e7f30768ac54b02e6ae02 (diff)
downloadrunit-5944840b7e27b9a732c20e5013a796eb092bf319.tar.gz
runit-5944840b7e27b9a732c20e5013a796eb092bf319.tar.xz
runit-5944840b7e27b9a732c20e5013a796eb092bf319.zip
* sv.c: on 'down', send runsv the 'down' command properly if not yet
    done (e.g. when taken up with 'once').
Diffstat (limited to 'src')
-rw-r--r--src/sv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/sv.c b/src/sv.c
index 0db0b1e..d126cee 100644
--- a/src/sv.c
+++ b/src/sv.c
@@ -246,7 +246,8 @@ int check(char *a) {
 }
 int control(char *a) {
   if (svstatus_get() <= 0) return(-1);
-  if (svstatus[17] == *a) return(0);
+  if (svstatus[17] == *a)
+    if (*a != 'd' || svstatus[18] == 1) return(0); /* once w/o term */
   if ((fd =open_write("supervise/control")) == -1) {
     if (errno != error_nodevice)
       warn("unable to open supervise/control");