changeset 5034:f9341cac877d draft dhcpcd-7

compat: Fix a typo in pidfile when O_CLOEXEC is not defined While here, include fcntl.h in if.c for older environments.
author Petr Gotthard <petr.gotthard@advantech-bb.cz>
date Wed, 05 Feb 2020 15:35:44 +0000
parents ef5e02dc19be
children 93b0040bf18b
files compat/pidfile.c src/if.c
diffstat 2 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/compat/pidfile.c	Tue Dec 31 14:06:40 2019 +0000
+++ b/compat/pidfile.c	Wed Feb 05 15:35:44 2020 +0000
@@ -208,7 +208,7 @@
 			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;
 
--- a/src/if.c	Tue Dec 31 14:06:40 2019 +0000
+++ b/src/if.c	Wed Feb 05 15:35:44 2020 +0000
@@ -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>