]> git.cworth.org Git - tar/blobdiff - gnu/utimens.c
Imported Upstream version 1.24
[tar] / gnu / utimens.c
index 8ce10d104874144165ba7a1b8d446431352a177a..0cf26714b165dd6d2f41203ee94c69b520c9087a 100644 (file)
@@ -166,7 +166,7 @@ update_timespec (struct stat const *statbuf, struct timespec *ts[2])
    Return 0 on success, -1 (setting errno) on failure.  */
 
 int
-fdutimens (char const *file, int fd, struct timespec const timespec[2])
+fdutimens (int fd, char const *file, struct timespec const timespec[2])
 {
   struct timespec adjusted_timespec[2];
   struct timespec *ts = timespec ? adjusted_timespec : NULL;
@@ -302,7 +302,7 @@ fdutimens (char const *file, int fd, struct timespec const timespec[2])
   {
 #if HAVE_FUTIMESAT || HAVE_WORKING_UTIMES
     struct timeval timeval[2];
-    struct timeval const *t;
+    struct timeval *t;
     if (ts)
       {
         timeval[0].tv_sec = ts[0].tv_sec;
@@ -372,28 +372,12 @@ fdutimens (char const *file, int fd, struct timespec const timespec[2])
   }
 }
 
-/* Set the access and modification time stamps of FD (a.k.a. FILE) to be
-   TIMESPEC[0] and TIMESPEC[1], respectively.
-   FD must be either negative -- in which case it is ignored --
-   or a file descriptor that is open on FILE.
-   If FD is nonnegative, then FILE can be NULL, which means
-   use just futimes (or equivalent) instead of utimes (or equivalent),
-   and fail if on an old system without futimes (or equivalent).
-   If TIMESPEC is null, set the time stamps to the current time.
-   Return 0 on success, -1 (setting errno) on failure.  */
-
-int
-gl_futimens (int fd, char const *file, struct timespec const timespec[2])
-{
-  return fdutimens (file, fd, timespec);
-}
-
 /* Set the access and modification time stamps of FILE to be
    TIMESPEC[0] and TIMESPEC[1], respectively.  */
 int
 utimens (char const *file, struct timespec const timespec[2])
 {
-  return fdutimens (file, -1, timespec);
+  return fdutimens (-1, file, timespec);
 }
 
 /* Set the access and modification time stamps of FILE to be
@@ -419,7 +403,7 @@ lutimens (char const *file, struct timespec const timespec[2])
 
   /* The Linux kernel did not support symlink timestamps until
      utimensat, in version 2.6.22, so we don't need to mimic
-     gl_futimens' worry about buggy NFS clients.  But we do have to
+     fdutimens' worry about buggy NFS clients.  But we do have to
      worry about bogus return values.  */
 
 #if HAVE_UTIMENSAT
@@ -486,7 +470,7 @@ lutimens (char const *file, struct timespec const timespec[2])
 #if HAVE_LUTIMES && !HAVE_UTIMENSAT
   {
     struct timeval timeval[2];
-    struct timeval const *t;
+    struct timeval *t;
     int result;
     if (ts)
       {
@@ -509,7 +493,7 @@ lutimens (char const *file, struct timespec const timespec[2])
   if (!(adjustment_needed || REPLACE_FUNC_STAT_FILE) && lstat (file, &st))
     return -1;
   if (!S_ISLNK (st.st_mode))
-    return fdutimens (file, -1, ts);
+    return fdutimens (-1, file, ts);
   errno = ENOSYS;
   return -1;
 }