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

src/main/event.c

index cd6dfce7f87862d769de9d8cf08adb7b1a4d9b55..44104dd367267ea715f447f048463c46ce36c952 100644 (file)
@@ -3622,12 +3622,14 @@ int radius_event_init(CONF_SECTION *cs, int spawn_flag)
                       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);