diff --git a/src/unix/fs.c b/src/unix/fs.c index a11e99a2..1957fc14 100644 --- a/src/unix/fs.c +++ b/src/unix/fs.c @@ -119,14 +119,17 @@ static ssize_t uv__fs_futime(uv_fs_t* req) { ts[1].tv_sec = req->mtime; ts[1].tv_nsec = (unsigned long)(req->mtime * 1000000) % 1000000 * 1000; return uv__utimesat(req->file, NULL, ts, 0); -#elif HAVE_FUTIMES +#elif defined(__APPLE__) \ + || defined(__DragonFly__) \ + || defined(__FreeBSD__) \ + || defined(__sun) struct timeval tv[2]; tv[0].tv_sec = req->atime; tv[0].tv_usec = (unsigned long)(req->atime * 1000000) % 1000000; tv[1].tv_sec = req->mtime; tv[1].tv_usec = (unsigned long)(req->mtime * 1000000) % 1000000; return futimes(req->file, tv); -#else /* !HAVE_FUTIMES */ +#else errno = ENOSYS; return -1; #endif diff --git a/src/unix/internal.h b/src/unix/internal.h index 4369cd40..60544618 100644 --- a/src/unix/internal.h +++ b/src/unix/internal.h @@ -31,13 +31,10 @@ # define inline __inline #endif -#undef HAVE_FUTIMES -#undef HAVE_KQUEUE #undef HAVE_PORTS_FS #if __linux__ # include "linux/syscalls.h" -# define HAVE_FUTIMES 1 /* emulated with utimesat() */ #endif /* __linux__ */ #if defined(__sun) @@ -46,22 +43,9 @@ # ifdef PORT_SOURCE_FILE # define HAVE_PORTS_FS 1 # endif -# define HAVE_FUTIMES 1 # define futimes(fd, tv) futimesat(fd, (void*)0, tv) #endif /* __sun */ -#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__sun) -# define HAVE_FUTIMES 1 -#endif - -/* FIXME exact copy of the #ifdef guard in uv-unix.h */ -#if defined(__APPLE__) \ - || defined(__FreeBSD__) \ - || defined(__OpenBSD__) \ - || defined(__NetBSD__) -# define HAVE_KQUEUE 1 -#endif - #if defined(__APPLE__) && !TARGET_OS_IPHONE # include #endif