]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
SETFD for O_NONBLOCK
authorAlan T. DeKok <aland@freeradius.org>
Thu, 20 Dec 2012 12:08:31 +0000 (07:08 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 20 Dec 2012 12:10:01 +0000 (07:10 -0500)
From Debian Bug #696250

src/main/process.c

index a762fa2bd1285815bcc16463c76ee14572bed0ed..663aeab8db2547c25b13aa1d959830d85aba2765 100644 (file)
@@ -4107,12 +4107,14 @@ int radius_event_init(CONF_SECTION *cs, int have_children)
                       strerror(errno));
                exit(1);
        }
-       if (fcntl(self_pipe[0], F_SETFL, O_NONBLOCK | FD_CLOEXEC) < 0) {
+       if ((fcntl(self_pipe[0], F_SETFL, O_NONBLOCK) < 0) ||
+           (fcntl(self_pipe[0], F_SETFD, FD_CLOEXEC) < 0)) {
                radlog(L_ERR, "radiusd: Error setting internal flags: %s",
                       strerror(errno));
                exit(1);
        }
-       if (fcntl(self_pipe[1], F_SETFL, O_NONBLOCK | FD_CLOEXEC) < 0) {
+       if ((fcntl(self_pipe[1], F_SETFL, O_NONBLOCK) < 0) ||
+           (fcntl(self_pipe[1], F_SETFD, FD_CLOEXEC) < 0)) {
                radlog(L_ERR, "radiusd: Error setting internal flags: %s",
                       strerror(errno));
                exit(1);