From: Alan T. DeKok Date: Thu, 20 Dec 2012 12:07:30 +0000 (-0500) Subject: SETFD for O_NONBLOCK X-Git-Tag: release_2_2_1~201 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=315b70ac7d380f633f9e4b7eec0db09bf801ddb8;p=thirdparty%2Ffreeradius-server.git SETFD for O_NONBLOCK From Debian Bug #696250 --- diff --git a/src/main/event.c b/src/main/event.c index cd6dfce7f87..44104dd3672 100644 --- a/src/main/event.c +++ b/src/main/event.c @@ -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);