summary refs log tree commit diff
path: root/src/runsvdir.c
diff options
context:
space:
mode:
authorGerrit Pape <pape@smarden.org>2002-09-24 14:12:05 +0000
committerGerrit Pape <pape@smarden.org>2002-09-24 14:12:05 +0000
commit4b9a7f9f96a945ca2a88b4d5d5886d4620f96a97 (patch)
treee556b20b31a3f06143b7f45414d7007aab076139 /src/runsvdir.c
parent987172af592f61ee4d8e24884f8eb29e29130012 (diff)
downloadrunit-4b9a7f9f96a945ca2a88b4d5d5886d4620f96a97.tar.gz
runit-4b9a7f9f96a945ca2a88b4d5d5886d4620f96a97.tar.xz
runit-4b9a7f9f96a945ca2a88b4d5d5886d4620f96a97.zip
support symlinked /service directory.
Diffstat (limited to 'src/runsvdir.c')
-rw-r--r--src/runsvdir.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/runsvdir.c b/src/runsvdir.c
index 7ba49d9..04922e7 100644
--- a/src/runsvdir.c
+++ b/src/runsvdir.c
@@ -59,6 +59,9 @@ void runsv(int no, char *name) {
     /* child */
     const char *prog[3];
 
+    if (chdir(svdir) == -1)
+      fatal("unable to change directory to", svdir);
+
     prog[0] ="runsv";
     prog[1] =name;
     prog[2] =0;
@@ -77,7 +80,7 @@ void runsvdir() {
   int i;
   struct stat s;
 
-  if (! (dir =opendir("."))) {
+  if (! (dir =opendir(svdir))) {
     warn("unable to open directory ", svdir);
     return;
   }
@@ -177,8 +180,6 @@ int main(int argc, char **argv) {
     }
   }
 
-  if (chdir(svdir) == -1)
-    fatal("unable to change directory to ", svdir);
 
   for (;;) {
     /* collect children */