]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
compat: Fix a typo in pidfile when O_CLOEXEC is not defined
authorPetr Gotthard <petr.gotthard@advantech-bb.cz>
Wed, 5 Feb 2020 15:35:44 +0000 (15:35 +0000)
committerRoy Marples <roy@marples.name>
Wed, 5 Feb 2020 15:35:44 +0000 (15:35 +0000)
While here, include fcntl.h in if.c for older environments.

compat/pidfile.c
src/if.c

index 6aea468b4d768a3104c1a5408d9fde8be21823f4..bd7887ac6daf6813fe68c10915528806519a1cd5 100644 (file)
@@ -208,7 +208,7 @@ pidfile_lock(const char *path)
                        goto return_pid;
 #ifndef O_CLOEXEC
                if ((opts = fcntl(fd, F_GETFD)) == -1 ||
-                   fctnl(fd, F_SETFL, opts | FD_CLOEXEC) == -1)
+                   fcntl(fd, F_SETFL, opts | FD_CLOEXEC) == -1)
                {
                        int error = errno;
 
index 044dba459d0178d253e1e178fe87d74c998d50d1..c58c9380820e2e3f7871a1edf1489f032a8da6f0 100644 (file)
--- a/src/if.c
+++ b/src/if.c
@@ -54,6 +54,7 @@
 #include <errno.h>
 #include <ifaddrs.h>
 #include <inttypes.h>
+#include <fcntl.h>
 #include <fnmatch.h>
 #include <stddef.h>
 #include <stdio.h>