From: Alan T. DeKok Date: Thu, 20 Dec 2012 12:08:31 +0000 (-0500) Subject: SETFD for O_NONBLOCK X-Git-Tag: release_3_0_0_beta1~1357 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a1f9a3616726f65bc9a26aca3a41672b700c263;p=thirdparty%2Ffreeradius-server.git SETFD for O_NONBLOCK From Debian Bug #696250 --- diff --git a/src/main/process.c b/src/main/process.c index a762fa2bd12..663aeab8db2 100644 --- a/src/main/process.c +++ b/src/main/process.c @@ -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);