X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fmisc.c;h=ca2921b0e0e6ad597f8967c41a40df3efcf92140;hb=098ad10c71e87f8003227aa10ad8c88ae43dce12;hp=64b1b2b3ea8b4104cff3a85d4d3ba14312b33a4b;hpb=d9458886432a92230e432e8e8492703c7afb8272;p=chaz%2Ftar diff --git a/src/misc.c b/src/misc.c index 64b1b2b..ca2921b 100644 --- a/src/misc.c +++ b/src/misc.c @@ -390,7 +390,7 @@ static char *before_backup_name; static char *after_backup_name; /* Return 1 if FILE_NAME is obviously "." or "/". */ -static bool +bool must_be_dot_or_slash (char const *file_name) { file_name += FILE_SYSTEM_PREFIX_LEN (file_name); @@ -613,21 +613,6 @@ deref_stat (bool deref, char const *name, struct stat *buf) return deref ? stat (name, buf) : lstat (name, buf); } -/* Use futimens if possible, utimensat otherwise. */ -int -fd_utimensat (int fd, int parentfd, char const *file, - struct timespec const ts[2], int atflag) -{ - if (0 <= fd) - { - int result = futimens (fd, ts); - if (! (result < 0 && errno == ENOSYS)) - return result; - } - - return utimensat (parentfd, file, ts, atflag); -} - /* Set FD's (i.e., assuming the working directory is PARENTFD, FILE's) access time to ATIME. ATFLAG controls symbolic-link following, in the style of openat. */ @@ -638,7 +623,7 @@ set_file_atime (int fd, int parentfd, char const *file, struct timespec atime, struct timespec ts[2]; ts[0] = atime; ts[1].tv_nsec = UTIME_OMIT; - return fd_utimensat (fd, parentfd, file, ts, atflag); + return fdutimensat (fd, parentfd, file, ts, atflag); } /* A description of a working directory. */