* sysdeps/mach/hurd/readdir_r.c (__readdir_r): Return error number
instead of -1 on failure. Don't forget to copy file name into
*ENTRY if successful. Set *RESULT to NULL upon reaching the end
of the directory.
2001-01-06 Mark Kettenis <kettenis@gnu.org>
2001-01-06 Mark Kettenis <kettenis@gnu.org>
2001-01-06 Mark Kettenis <kettenis@gnu.org>
+ * sysdeps/mach/hurd/readdir_r.c (__readdir_r): Return error number
+ instead of -1 on failure. Don't forget to copy file name into
+ *ENTRY if successful. Set *RESULT to NULL upon reaching the end
+ of the directory.
+
+2001-01-06 Mark Kettenis <kettenis@gnu.org>
+
* sysdeps/mach/hurd/xstatconv.c (xstat64_conv): Don't forget to
copy st_atime member.
* sysdeps/mach/hurd/xstatconv.c (xstat64_conv): Don't forget to
copy st_atime member.
-/* Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 94, 95, 96, 1997, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
__readdir_r (DIR *dirp, struct dirent *entry, struct dirent **result)
{
struct dirent *dp;
__readdir_r (DIR *dirp, struct dirent *entry, struct dirent **result)
{
struct dirent *dp;
if (dirp == NULL)
{
errno = EINVAL;
if (dirp == NULL)
{
errno = EINVAL;
}
__libc_lock_lock (dirp->__lock);
}
__libc_lock_lock (dirp->__lock);
char *data = dirp->__data;
int nentries;
char *data = dirp->__data;
int nentries;
if (err = HURD_FD_PORT_USE (dirp->__fd,
__dir_readdir (port,
if (err = HURD_FD_PORT_USE (dirp->__fd,
__dir_readdir (port,
+ memcpy (entry->d_name, dp->d_name, dp->d_namlen + 1);
__libc_lock_unlock (dirp->__lock);
__libc_lock_unlock (dirp->__lock);
+ return dp ? 0 : err ? errno : 0;
weak_alias (__readdir_r, readdir_r)
weak_alias (__readdir_r, readdir_r)