chdir_ = false;
}
+/* Will we chdir to "/" as part of daemonizing? */
+bool
+is_chdir_enabled(void)
+{
+ return chdir_;
+}
+
/* Normally, die_if_already_running() will terminate the program with a message
* if a locked pidfile already exists. If this function is called,
* die_if_already_running() will merely log a warning. */
detach = true;
}
+/* Will daemonize() really detach? */
+bool
+get_detach(void)
+{
+ return detach;
+}
+
/* If a pidfile has been configured and that pidfile already exists and is
* locked by a running process, returns the pid of the running process.
* Otherwise, returns 0. */
/* Child process. */
close(fds[0]);
make_pidfile();
- write(fds[1], &c, 1);
+ ignore(write(fds[1], &c, 1));
close(fds[1]);
setsid();
if (chdir_) {
- chdir("/");
+ ignore(chdir("/"));
}
time_postfork();
lockfile_postfork();