From: Andreas Schwab Date: Fri, 30 Oct 2009 15:11:14 +0000 (+0100) Subject: Merge remote branch 'origin/master' into fedora/master X-Git-Tag: fedora/glibc-2.10.90-27~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=017dd87448e913383a8be5773569f218e8c661c5;p=thirdparty%2Fglibc.git Merge remote branch 'origin/master' into fedora/master --- 017dd87448e913383a8be5773569f218e8c661c5 diff --cc sysdeps/unix/sysv/linux/futimesat.c index 5f3a3f52f31,bb83e74faf2..8292533afb2 --- a/sysdeps/unix/sysv/linux/futimesat.c +++ b/sysdeps/unix/sysv/linux/futimesat.c @@@ -58,9 -58,30 +58,15 @@@ 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); + if (__builtin_expect (filelen == 0, 0)) + { + __set_errno (ENOENT); + return -1; + } + static const char procfd[] = "/proc/self/fd/%d/%s"; /* Buffer for the path name we are going to use. It consists of - the string /proc/self/fd/