20 #ifdef HAVE_SYS_TYPES_H
21 #include <sys/types.h>
68 log_err(
LD_GENERAL,
"pipe failed; exiting. Error was %s", strerror(errno));
134 if (chdir(desired_cwd) < 0) {
135 log_err(
LD_GENERAL,
"chdir to \"%s\" failed. Exiting.",desired_cwd);
142 log_err(
LD_GENERAL,
"/dev/null can't be opened. Exiting.");
150 if (dup2(nullfd,0) < 0 ||
151 dup2(nullfd,1) < 0 ||
152 dup2(nullfd,2) < 0) {
void set_main_thread(void)
static int finish_daemon_called
bool start_daemon_has_been_called(void)
int finish_daemon(const char *desired_cwd)
static int daemon_filedes[2]
static int start_daemon_called
Wrappers for reading and writing data to files on disk.
int tor_open_cloexec(const char *path, int flags, unsigned mode)