Skip to content
Snippets Groups Projects
Commit ab4529f4 authored by Tobias S. Josefowitz's avatar Tobias S. Josefowitz
Browse files

Process: only offer daemon() when fork() or System.daemon() are available.

parent 68ef3c39
No related branches found
No related tags found
No related merge requests found
...@@ -1101,15 +1101,16 @@ class Spawn ...@@ -1101,15 +1101,16 @@ class Spawn
#endif #endif
#endif #endif
#if constant(fork) || constant(System.daemon)
private int low_daemon(int nochdir, int noclose) private int low_daemon(int nochdir, int noclose)
{ {
#if System.daemon #if constant(System.daemon)
return System.daemon(nochdir, noclose); return System.daemon(nochdir, noclose);
#else #else
if (fork()) if (fork())
exit(0); exit(0);
#if System.setsid #if constant(System.setsid)
System.setsid(); System.setsid();
#endif /* System.setsid */ #endif /* System.setsid */
...@@ -1210,3 +1211,4 @@ void daemon(int nochdir, int noclose, ...@@ -1210,3 +1211,4 @@ void daemon(int nochdir, int noclose,
opened->close(); opened->close();
} }
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment