]> 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>
Mon, 10 Feb 2020 21:22:36 +0000 (21:22 +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 28597dc239f1e8c1d8a2cffe21e4df75c547c92d..1ff2ad05af486b96bcb1932ea4e291491dfb34fb 100644 (file)
--- a/src/if.c
+++ b/src/if.c
@@ -53,6 +53,7 @@
 #include <errno.h>
 #include <ifaddrs.h>
 #include <inttypes.h>
+#include <fcntl.h>
 #include <fnmatch.h>
 #include <stddef.h>
 #include <stdio.h>