Fix compile error on MacOS X (and other platforms without O_CLOEXEC)

This commit is contained in:
Steven Murdoch 2010-11-20 13:50:55 +00:00
parent b4f56dd4c6
commit 9d63dfcf49

View File

@ -112,7 +112,7 @@ tor_open_cloexec(const char *path, int flags, unsigned mode)
int fd = open(path, flags, mode);
#ifdef FD_CLOEXEC
if (fd >= 0)
fcntl(s, F_SETFD, FD_CLOEXEC);
fcntl(fd, F_SETFD, FD_CLOEXEC);
#endif
return fd;
#endif