Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/gen - remove a wrong _DIAGASSERT
details: https://anonhg.NetBSD.org/src/rev/52014f8e1911
branches: trunk
changeset: 757710:52014f8e1911
user: yamt <yamt%NetBSD.org@localhost>
date: Thu Sep 16 02:38:50 2010 +0000
description:
- remove a wrong _DIAGASSERT
- update comments
- whitespace
diffstat:
lib/libc/gen/dirent_private.h | 8 ++++----
lib/libc/gen/opendir.c | 13 ++++++-------
lib/libc/gen/readdir.c | 5 ++---
3 files changed, 12 insertions(+), 14 deletions(-)
diffs (103 lines):
diff -r 343e6e870ec2 -r 52014f8e1911 lib/libc/gen/dirent_private.h
--- a/lib/libc/gen/dirent_private.h Thu Sep 16 00:26:49 2010 +0000
+++ b/lib/libc/gen/dirent_private.h Thu Sep 16 02:38:50 2010 +0000
@@ -1,14 +1,14 @@
-/* $NetBSD: dirent_private.h,v 1.2 2008/05/04 18:53:26 tonnerre Exp $ */
+/* $NetBSD: dirent_private.h,v 1.3 2010/09/16 02:38:50 yamt Exp $ */
/*
* One struct _dirpos is malloced to describe the current directory
* position each time telldir is called. It records the current magic
- * cookie returned by getdirentries and the offset within the buffer
- * associated with that return value.
+ * cookie returned by getdents and the offset within the buffer associated
+ * with that return value.
*/
struct dirpos {
struct dirpos *dp_next; /* next structure in list */
- off_t dp_seek; /* magic cookie returned by getdirentries */
+ off_t dp_seek; /* magic cookie returned by getdents */
long dp_loc; /* offset of entry in buffer */
};
diff -r 343e6e870ec2 -r 52014f8e1911 lib/libc/gen/opendir.c
--- a/lib/libc/gen/opendir.c Thu Sep 16 00:26:49 2010 +0000
+++ b/lib/libc/gen/opendir.c Thu Sep 16 02:38:50 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: opendir.c,v 1.35 2009/01/11 02:46:27 christos Exp $ */
+/* $NetBSD: opendir.c,v 1.36 2010/09/16 02:38:50 yamt Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)opendir.c 8.7 (Berkeley) 12/10/94";
#else
-__RCSID("$NetBSD: opendir.c,v 1.35 2009/01/11 02:46:27 christos Exp $");
+__RCSID("$NetBSD: opendir.c,v 1.36 2010/09/16 02:38:50 yamt Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -104,8 +104,6 @@
int unionstack, nfsdir;
struct statvfs sfb;
- _DIAGASSERT(name != NULL);
-
if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
goto error;
if (fstat(fd, &sb) || !S_ISDIR(sb.st_mode)) {
@@ -120,7 +118,7 @@
* If the machine's page size is an exact multiple of DIRBLKSIZ,
* use a buffer that is cluster boundary aligned.
* Hopefully this can be a big win someday by allowing page trades
- * to user space to be done by getdirentries()
+ * to user space to be done by getdents()
*/
if (((pagesz = getpagesize()) % DIRBLKSIZ) == 0)
incr = pagesz;
@@ -140,7 +138,8 @@
else
unionstack = 0;
- nfsdir = !(strncmp(sfb.f_fstypename, MOUNT_NFS, sizeof(sfb.f_fstypename)));
+ nfsdir = !(strncmp(sfb.f_fstypename, MOUNT_NFS,
+ sizeof(sfb.f_fstypename)));
if (unionstack || nfsdir) {
size_t len;
@@ -175,7 +174,7 @@
do {
/*
* Always make at least DIRBLKSIZ bytes
- * available to getdirentries
+ * available to getdents
*/
if (space < DIRBLKSIZ) {
space += incr;
diff -r 343e6e870ec2 -r 52014f8e1911 lib/libc/gen/readdir.c
--- a/lib/libc/gen/readdir.c Thu Sep 16 00:26:49 2010 +0000
+++ b/lib/libc/gen/readdir.c Thu Sep 16 02:38:50 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: readdir.c,v 1.24 2008/05/04 18:53:26 tonnerre Exp $ */
+/* $NetBSD: readdir.c,v 1.25 2010/09/16 02:38:50 yamt Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)readdir.c 8.3 (Berkeley) 9/29/94";
#else
-__RCSID("$NetBSD: readdir.c,v 1.24 2008/05/04 18:53:26 tonnerre Exp $");
+__RCSID("$NetBSD: readdir.c,v 1.25 2010/09/16 02:38:50 yamt Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -58,7 +58,6 @@
{
struct dirent *dp;
-
for (;;) {
if (dirp->dd_loc >= dirp->dd_size) {
if (dirp->dd_flags & __DTF_READALL)
Home |
Main Index |
Thread Index |
Old Index