]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
* sysdeps/unix/sysv/linux/futimesat.c (futimesat): If
authorJakub Jelinek <jakub@redhat.com>
Fri, 3 Feb 2006 09:43:55 +0000 (09:43 +0000)
committerJakub Jelinek <jakub@redhat.com>
Fri, 3 Feb 2006 09:43:55 +0000 (09:43 +0000)
file == NULL, use __futimes unconditionally.

* manual/filesys.texi (futimes): Fix prototype.

ChangeLog
manual/filesys.texi
sysdeps/unix/sysv/linux/futimesat.c

index 77405ff2a03d4c69812e9def9467870bf845199c..202ae32a38967c2fea7e263cc4c304885473ea22 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-02-03  Jakub Jelinek  <jakub@redhat.com>
+
+       * sysdeps/unix/sysv/linux/futimesat.c (futimesat): If
+       file == NULL, use __futimes unconditionally.
+
+       * manual/filesys.texi (futimes): Fix prototype.
+
 2006-02-02  Jakub Jelinek  <jakub@redhat.com>
 
        * math/math.h (__nldbl_nexttowardf): Put __THROW before
index c8ae3772662d27d60570bdda14c6ad9fd75a6582..2436f22e884fb7e9771c2e346566f69c02d63ddc 100644 (file)
@@ -2806,7 +2806,7 @@ function.
 
 @comment sys/time.h
 @comment BSD
-@deftypefun int futimes (int *@var{fd}, struct timeval @var{tvp}@t{[2]})
+@deftypefun int futimes (int @var{fd}, struct timeval @var{tvp}@t{[2]})
 This function is like @code{utimes}, except that it takes an open file
 descriptor as an argument instead of a file name.  @xref{Low-Level
 I/O}.  This function comes from FreeBSD, and is not available on all
index 7c96b780450435baadad8c4d17f80d16e37518c6..5f3a3f52f316b2e6ae9b5aaf51fca0ce34911473 100644 (file)
@@ -37,14 +37,14 @@ futimesat (fd, file, tvp)
 {
   int result;
 
+  if (file == NULL)
+    return __futimes (fd, tvp);
+
 #ifdef __NR_futimesat
 # ifndef __ASSUME_ATFCTS
   if (__have_atfcts >= 0)
 # endif
     {
-      if (file == NULL)
-       return __futimes (fd, tvp);
-
       result = INLINE_SYSCALL (futimesat, 3, fd, file, tvp);
 # ifndef __ASSUME_ATFCTS
       if (result == -1 && errno == ENOSYS)
@@ -58,22 +58,7 @@ futimesat (fd, file, tvp)
 #ifndef __ASSUME_ATFCTS
   char *buf = NULL;
 
-  if (file == NULL)
-    {
-      static const char procfd[] = "/proc/self/fd/%d";
-      /* Buffer for the path name we are going to use.  It consists of
-        - the string /proc/self/fd/
-        - the file descriptor number.
-        The final NUL is included in the sizeof.   A bit of overhead
-        due to the format elements compensates for possible negative
-        numbers.  */
-      size_t buflen = sizeof (procfd) + sizeof (int) * 3;
-      buf = alloca (buflen);
-
-      __snprintf (buf, buflen, procfd, fd);
-      file = buf;
-    }
-  else if (fd != AT_FDCWD && file[0] != '/')
+  if (fd != AT_FDCWD && file[0] != '/')
     {
       size_t filelen = strlen (file);
       static const char procfd[] = "/proc/self/fd/%d/%s";