summary refs log tree commit diff
path: root/src/runsv.c
diff options
context:
space:
mode:
authorGerrit Pape <pape@smarden.org>2002-09-24 11:17:12 +0000
committerGerrit Pape <pape@smarden.org>2002-09-24 11:17:12 +0000
commit15b27501f67265679c86285d5f4b77c7a051df1c (patch)
treea5cdc18135ab24b6c258c6f4f138e2052abe526c /src/runsv.c
parent128c3d46e04c5ec3b467ef30861970dded5fc124 (diff)
downloadrunit-15b27501f67265679c86285d5f4b77c7a051df1c.tar.gz
runit-15b27501f67265679c86285d5f4b77c7a051df1c.tar.xz
runit-15b27501f67265679c86285d5f4b77c7a051df1c.zip
code cleanup.
Diffstat (limited to 'src/runsv.c')
-rw-r--r--src/runsv.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/runsv.c b/src/runsv.c
index 2026b1c..efb7968 100644
--- a/src/runsv.c
+++ b/src/runsv.c
@@ -221,11 +221,12 @@ void startservice(struct svdir *s) {
     else
       fatal2("unable to start ", *run);
   }
-  if (s->state != S_FINISH)
+  if (s->state != S_FINISH) {
     taia_now(&s->start);
+    s->state =S_RUN;
+  }
   s->pid =p;
   s->ctrl =C_NOOP;
-  if (s->state != S_FINISH) s->state =S_RUN;
   update_status(s);
   sleep(1);
 }
@@ -242,6 +243,7 @@ int ctrl(struct svdir *s, char c) {
     if (s->pid == 0) startservice(s);
     else update_status(s);
     break;
+  case 'e':
   case 'x': /* exit */
     if (s->islog) break;
     s->want =W_EXIT;