summaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/process.c b/src/process.c
index ab4b37e3..180efa51 100644
--- a/src/process.c
+++ b/src/process.c
@@ -63,9 +63,12 @@ int osmo_daemonize(void)
return rc;
/* Redirect stdio to /dev/null */
+/* since C89/C99 says stderr is a macro, we can safely do this! */
+#ifdef stderr
freopen("/dev/null", "r", stdin);
freopen("/dev/null", "w", stdout);
freopen("/dev/null", "w", stderr);
+#endif
return 0;
}