]> arthur.barton.de Git - ngircd-alex.git/commitdiff
Only try to set FD_CLOEXEC if this flag is defined
authorAlexander Barton <alex@barton.de>
Tue, 19 Oct 2010 20:17:12 +0000 (22:17 +0200)
committerAlexander Barton <alex@barton.de>
Tue, 19 Oct 2010 20:17:12 +0000 (22:17 +0200)
A/UX 3.x doesn't implement this constant, for example.

src/ngircd/io.c

index 6843899d5b61e280895e20577072c98282b464f9..411b383ef3ed6393d63b5417e2f851119f1f008f 100644 (file)
@@ -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;
 }