summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Gotthard <petr.gotthard@advantech-bb.cz>2020-02-05 15:35:44 +0000
committerRoy Marples <roy@marples.name>2020-02-05 15:35:44 +0000
commit1c9a59bca4b99e4523c179a75b0b9d67173c518e (patch)
tree7a48906ef11db0b5565a8f6954d0f2b8c072fd0b
parent60bde9c63e01f1932e0ce782946989f942739dfb (diff)
downloaddhcpcd-1c9a59bca4b99e4523c179a75b0b9d67173c518e.tar.xz
compat: Fix a typo in pidfile when O_CLOEXEC is not defined
While here, include fcntl.h in if.c for older environments.
-rw-r--r--compat/pidfile.c2
-rw-r--r--src/if.c1
2 files changed, 2 insertions, 1 deletions
diff --git a/compat/pidfile.c b/compat/pidfile.c
index 6aea468b..bd7887ac 100644
--- a/compat/pidfile.c
+++ b/compat/pidfile.c
@@ -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;
diff --git a/src/if.c b/src/if.c
index 044dba45..c58c9380 100644
--- 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>