Change directory only when detaching

pull/5/head
Michael Spang 14 years ago
parent 43319f134b
commit 628c9076fe
  1. 4
      src/dmaster.c

@ -68,9 +68,9 @@ static void setup_signals(void) {
}
static void setup_daemon(void) {
if (chdir("/"))
fatalpe("chdir('/')");
if (detach) {
if (chdir("/"))
fatalpe("chdir('/')");
pid_t pid = fork();
if (pid < 0)
fatalpe("fork");

Loading…
Cancel
Save