From ab4529f44ca113683ddb9ed80a1ed3c8d1ae2b32 Mon Sep 17 00:00:00 2001 From: "Tobias S. Josefowitz" <tobij@tobij.de> Date: Sun, 3 Nov 2013 11:05:30 +0100 Subject: [PATCH] Process: only offer daemon() when fork() or System.daemon() are available. --- lib/modules/Process.pmod | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/modules/Process.pmod b/lib/modules/Process.pmod index 9646e3affc..65a407ecd6 100644 --- a/lib/modules/Process.pmod +++ b/lib/modules/Process.pmod @@ -1101,15 +1101,16 @@ class Spawn #endif #endif +#if constant(fork) || constant(System.daemon) private int low_daemon(int nochdir, int noclose) { -#if System.daemon +#if constant(System.daemon) return System.daemon(nochdir, noclose); #else if (fork()) exit(0); -#if System.setsid +#if constant(System.setsid) System.setsid(); #endif /* System.setsid */ @@ -1210,3 +1211,4 @@ void daemon(int nochdir, int noclose, opened->close(); } +#endif -- GitLab