Commit Diff


commit - aada9b0335c17c413099d33e3bf242a160871115
commit + 1962c34091c4aed0109904507f57275774661700
blob - 506e9b231e26359c8045457966e9c33cbfa2f667
blob + ed2225cd822f1575fc0c616db6ec43a325bbd1a9
--- gotwebd/gotwebd.c
+++ gotwebd/gotwebd.c
@@ -355,7 +355,7 @@ main(int argc, char **argv)
 		return 1;
 	}
 
-	if (!env->gotwebd_debug && daemon(0, 0) == -1)
+	if (!env->gotwebd_debug && daemon(1, 0) == -1)
 		fatal("daemon");
 
 	event_init();
@@ -370,6 +370,9 @@ main(int argc, char **argv)
 			fatal("spawn_socket_process");
 	}
 
+	if (chdir("/") == -1)
+		fatal("chdir /");
+
 	log_procinit("gotwebd");
 
 	log_info("%s startup", getprogname());