summaryrefslogtreecommitdiff
path: root/gpspipe.c
diff options
context:
space:
mode:
authorFred Wright <fw@fwright.net>2017-01-22 01:44:19 -0800
committerFred Wright <fw@fwright.net>2017-01-22 14:02:55 -0800
commit2cb17f91607bdfd9cd7ad80f7232db8b1bd23d34 (patch)
tree452241687896ffdf45d2a002478bf970d67ec7a0 /gpspipe.c
parentcb1403d842a2fdbe6109eaf48acb7a494f30784d (diff)
downloadgpsd-2cb17f91607bdfd9cd7ad80f7232db8b1bd23d34.tar.gz
Centralizes daemon() calls.
This defines a new function os_daemon() (in os_compat.c), which is either the old replacement daemon() renamed, or a wrapper around the actual daemon() call. This allows any issues related to daemon() (which exist on some platforms) to be dealt with in one place. No such changes are present yet, so platforms giving warnings for the use of daemon() continue to do so, but now only in the compilation of os_compat.c. Unfortunately, the current build procedure typically compiles os_compat.c multiple times, so the warnings still appear multiple times. TESTED: Ran "scons build-all check" on OSX 10.9, OSX 10.12, Ubuntu 14, and FreeBSD 10.3.
Diffstat (limited to 'gpspipe.c')
-rw-r--r--gpspipe.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/gpspipe.c b/gpspipe.c
index 6e133f48..680f0625 100644
--- a/gpspipe.c
+++ b/gpspipe.c
@@ -25,8 +25,6 @@
/* cfmakeraw() needs _DEFAULT_SOURCE */
#define _DEFAULT_SOURCE
-/* daemon() needs _DEFAULT_SOURCE */
-#define _DEFAULT_SOURCE
#include <time.h> /* for time_t */
@@ -251,7 +249,7 @@ int main(int argc, char **argv)
/* Daemonize if the user requested it. */
if (daemonize)
- if (daemon(0, 0) != 0)
+ if (os_daemon(0, 0) != 0)
(void)fprintf(stderr,
"gpspipe: demonization failed: %s\n",
strerror(errno));