aboutsummaryrefslogtreecommitdiffstats
path: root/src/charon/charon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/charon/charon.c')
-rw-r--r--src/charon/charon.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/charon/charon.c b/src/charon/charon.c
index 5d866ee0d..f23717034 100644
--- a/src/charon/charon.c
+++ b/src/charon/charon.c
@@ -221,7 +221,12 @@ static bool check_pidfile()
int fd;
fd = fileno(pidfile);
- if (fd == -1 || fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
+ if (fd == -1)
+ {
+ DBG1(DBG_DMN, "unable to determine fd for '"PID_FILE"'");
+ return TRUE;
+ }
+ if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
{
DBG1(DBG_LIB, "setting FD_CLOEXEC for '"PID_FILE"' failed: %s",
strerror(errno));