diff options
Diffstat (limited to 'runit')
-rw-r--r-- | runit/runsv.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/runit/runsv.c b/runit/runsv.c index 20f849528..f70b51390 100644 --- a/runit/runsv.c +++ b/runit/runsv.c | |||
@@ -313,14 +313,11 @@ static void startservice(struct svdir *s) | |||
313 | /* child */ | 313 | /* child */ |
314 | if (haslog) { | 314 | if (haslog) { |
315 | if (s->islog) { | 315 | if (s->islog) { |
316 | if (dup2(logpipe[0], 0) == -1) | 316 | xdup2(logpipe[0], 0); |
317 | fatal_cannot("setup filedescriptor for ./log/run"); | ||
318 | close(logpipe[1]); | 317 | close(logpipe[1]); |
319 | if (chdir("./log") == -1) | 318 | xchdir("./log"); |
320 | fatal_cannot("change directory to ./log"); | ||
321 | } else { | 319 | } else { |
322 | if (dup2(logpipe[1], 1) == -1) | 320 | xdup2(logpipe[1], 1); |
323 | fatal_cannot("setup filedescriptor for ./run"); | ||
324 | close(logpipe[0]); | 321 | close(logpipe[0]); |
325 | } | 322 | } |
326 | } | 323 | } |