From 24f5e2fc62606c25c4b43e2dd77aea9aa721acba Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Tue, 15 Nov 2016 13:37:14 +0900 Subject: build: massively remove needless checks Since we have autoconf results from a wide swath of target platforms, we can go remove checks that have the same result on all systems. This also removes several "fallback" implementations of functions that, at some point in the history, weren't available on all target platforms. Signed-off-by: David Lamparter --- lib/pid_output.c | 31 ------------------------------- 1 file changed, 31 deletions(-) (limited to 'lib/pid_output.c') diff --git a/lib/pid_output.c b/lib/pid_output.c index de4c2fba99..ba1f37476e 100644 --- a/lib/pid_output.c +++ b/lib/pid_output.c @@ -27,35 +27,6 @@ #include "network.h" #define PIDFILE_MASK 0644 -#ifndef HAVE_FCNTL - -pid_t -pid_output (const char *path) -{ - FILE *fp; - pid_t pid; - mode_t oldumask; - - pid = getpid(); - - oldumask = umask(0777 & ~PIDFILE_MASK); - fp = fopen (path, "w"); - if (fp != NULL) - { - fprintf (fp, "%d\n", (int) pid); - fclose (fp); - umask(oldumask); - return pid; - } - /* XXX Why do we continue instead of exiting? This seems incompatible - with the behavior of the fcntl version below. */ - zlog_warn("Can't fopen pid lock file %s (%s), continuing", - path, safe_strerror(errno)); - umask(oldumask); - return -1; -} - -#else /* HAVE_FCNTL */ pid_t pid_output (const char *path) @@ -107,5 +78,3 @@ pid_output (const char *path) } return pid; } - -#endif /* HAVE_FCNTL */ -- cgit v1.2.3