Commit Diff


commit - ba5f8ecfda4faf3a01c519d51f2dab5a762c26a9
commit + 4056db6342e0499ecd1cd53b959f9a46eea64358
blob - 232071082602c61b4e6c32805f8e173c9d8b7e1b
blob + 388afd09354459f0e51fb97f0f90691c05674609
--- gotwebd/gotwebd.c
+++ gotwebd/gotwebd.c
@@ -356,7 +356,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();
@@ -371,6 +371,9 @@ main(int argc, char **argv)
 			fatal("spawn_socket_process");
 	}
 
+	if (chdir("/") == -1)
+		fatal("chdir /");
+
 	log_procinit("gotwebd");
 
 	log_info("%s startup", getprogname());