repo: ngircd
action: commit
revision: 
path_from: 
revision_from: 99e08eaced30fc80c91be9fdb8635409a4b93500:
path_to: 
revision_to: 
git.thebackupbox.net
ngircd
git clone git://git.thebackupbox.net/ngircd
commit 99e08eaced30fc80c91be9fdb8635409a4b93500
Author: Alexander Barton 
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.

diff --git a/src/ngircd/io.c b/src/ngircd/io.c
index 6843899d5b61e280895e20577072c98282b464f9..
index ..411b383ef3ed6393d63b5417e2f851119f1f008f 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;
 }

-----END OF PAGE-----