From 1920513735e437d766b087ccbc2ea6265ceae50a Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 12 Aug 2013 07:46:21 +0200 Subject: [PATCH] sunos: remove futimes() macro Remove a macro from src/unix/internal.h that aliases futimes() to futimesat(). Deal with the platform inconsistency in src/unix/fs.c. --- src/unix/fs.c | 4 ++++ src/unix/internal.h | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/unix/fs.c b/src/unix/fs.c index ecd2b239..6cabf513 100644 --- a/src/unix/fs.c +++ b/src/unix/fs.c @@ -176,7 +176,11 @@ skip: 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; +# if defined(__sun) + return futimesat(req->file, NULL, tv); +# else return futimes(req->file, tv); +# endif #else errno = ENOSYS; return -1; diff --git a/src/unix/internal.h b/src/unix/internal.h index 5816be0e..4c8bdb53 100644 --- a/src/unix/internal.h +++ b/src/unix/internal.h @@ -39,7 +39,6 @@ #if defined(__sun) # include # include -# define futimes(fd, tv) futimesat(fd, (void*)0, tv) #endif /* __sun */ #if defined(__APPLE__) && !TARGET_OS_IPHONE