Fix deamon mode on macos

This commit is contained in:
Camille Scholtz
2025-01-30 21:36:23 +01:00
committed by Max Kellermann
parent 407db96d4a
commit e3cf9bb0a1
5 changed files with 62 additions and 0 deletions

View File

@@ -134,6 +134,8 @@ daemonize_begin(bool detach)
/* move to a child process */
#ifndef __APPLE__
pid_t pid = fork();
if (pid < 0)
throw MakeErrno("fork() failed");
@@ -178,6 +180,8 @@ daemonize_begin(bool detach)
WCOREDUMP(status) ? " (core dumped)" : "");
std::exit(WEXITSTATUS(status));
#endif
}
void