Alexander Barton : Only try to set FD_CLOEXEC if this flag is defined
Module: ngircd.git Branch: master Commit: 99e08eaced30fc80c91be9fdb8635409a4b93500 URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=99e08eace... Author: Alexander Barton <alex@barton.de> Date: Tue Oct 19 22:17:12 2010 +0200 Only try to set FD_CLOEXEC if this flag is defined A/UX 3.x doesn't implement this constant, for example. --- src/ngircd/io.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/src/ngircd/io.c b/src/ngircd/io.c index 6843899..411b383 100644 --- a/src/ngircd/io.c +++ b/src/ngircd/io.c @@ -791,7 +791,9 @@ io_setcloexec(int fd) int flags = fcntl(fd, F_GETFD); if (flags == -1) return false; +#ifdef FD_CLOEXEC flags |= FD_CLOEXEC; +#endif return fcntl(fd, F_SETFD, flags) == 0; }
Teilnehmer (1)
-
alex@arthur.barton.de