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-10 21:22:36 +0000
commit9c1091218d1acb6c38b5e012f03ec1ecac682e36 (patch)
tree1a8efea399ff8b89df163304240b9130b2dc8717
parentead07a8079eb4863111d1ce8ace76bf0fa53016e (diff)
downloaddhcpcd-9c1091218d1acb6c38b5e012f03ec1ecac682e36.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 28597dc2..1ff2ad05 100644
--- 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>