return -1;
}
-#ifdef HAVE_FDOPENDIR
+#ifdef HAVE_OPENAT
int fd = openat (dir, local_name, flags, mode);
# ifdef HAVE_FCNTL
if (fd != -1)
if (fd != -1)
{
#ifndef WIN32
- fcntl (fd, F_SETFD, FD_CLOEXEC);
- if (nonblock)
- fcntl (fd, F_SETFL, fcntl (fd, F_GETFL, 0) | O_NONBLOCK);
+ fcntl (fd, F_SETFD, FD_CLOEXEC);
+ if (nonblock)
+ fcntl (fd, F_SETFL, fcntl (fd, F_GETFL, 0) | O_NONBLOCK);
#else
- if (nonblock)
- ioctlsocket (fd, FIONBIO, &(unsigned long){ 1 });
+ if (nonblock)
+ ioctlsocket (fd, FIONBIO, &(unsigned long){ 1 });
#endif
return fd;
}