diff --git a/src/futimesat.cpp b/src/futimesat.cpp deleted file mode 100644 index f99e606e..00000000 --- a/src/futimesat.cpp +++ /dev/null @@ -1,5 +0,0 @@ -#include "futimesat.hpp" - -#ifdef __APPLE__ -#include "futimesat_osx.icpp" -#endif diff --git a/src/futimesat.hpp b/src/futimesat.hpp deleted file mode 100644 index 7fb3bfec..00000000 --- a/src/futimesat.hpp +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef __UTIMESAT_HPP__ -#define __UTIMESAT_HPP__ - -#if __APPLE__ -int -_futimesat(int dirfd, const char* path, struct timeval *tvp); -#endif - -#endif diff --git a/src/futimesat_osx.icpp b/src/futimesat_osx.icpp deleted file mode 100644 index 70c2986c..00000000 --- a/src/futimesat_osx.icpp +++ /dev/null @@ -1,35 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include /* MAXPATHLEN */ - - -int -_futimesat(int fd, const char* path, struct timeval *tvp) { - char fullpath[MAXPATHLEN]; - - // Handle absolute paths - if(path[0] == '/') { - return ::utimes(path,tvp); - } - - // OS X 10.12 (at least) has an issue with using AT_FDCWD in this specific call. - if (fd == AT_FDCWD) { - if (getcwd((char*)fullpath, MAXPATHLEN) == NULL) { - return -1; - } - } else { - if (fcntl(fd,F_GETPATH,fullpath) < 0) { - return -1; - } - } - - if (strlcat(fullpath, "/", MAXPATHLEN) > MAXPATHLEN || strlcat(fullpath, path, MAXPATHLEN) > MAXPATHLEN) { - return (errno=ENAMETOOLONG,-1); - } - - return ::utimes(fullpath,tvp);; -}