From 18b8e054cf34f78f100b74b37e54673730530249 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 14 Oct 2005 21:11:09 +0000 Subject: * sysdeps/unix/opendir.c (__opendir): Pass extra argument to __alloc_dir. (__alloc_dir): Only close descriptor on error if new parameter is true. * sysdeps/unix/fdopendir.c (fdopendir): Pass extra argument to __alloc_dir. Don't close fd on error. * include/dirent.h (__alloc_dir): Adjust prototype. * include/sys/mman.h (__mremap): Add ellipsis. * malloc/memusage.c: Adjust mremap wrapper for optional additional parameter. --- sysdeps/unix/fdopendir.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sysdeps/unix/fdopendir.c') diff --git a/sysdeps/unix/fdopendir.c b/sysdeps/unix/fdopendir.c index 3c481fcf0d..ef6c97c308 100644 --- a/sysdeps/unix/fdopendir.c +++ b/sysdeps/unix/fdopendir.c @@ -29,14 +29,12 @@ fdopendir (int fd) struct stat64 statbuf; if (__builtin_expect (__fxstat64 (_STAT_VER, fd, &statbuf), 0) < 0) - goto out; + return NULL; if (__builtin_expect (! S_ISDIR (statbuf.st_mode), 0)) { __set_errno (ENOTDIR); - out: - close_not_cancel_no_status (fd); return NULL; } - return __alloc_dir (fd, &statbuf); + return __alloc_dir (fd, false, &statbuf); } -- cgit v1.2.3