Module Name:    src
Committed By:   yamt
Date:           Thu Sep 16 02:38:50 UTC 2010

Modified Files:
        src/lib/libc/gen: dirent_private.h opendir.c readdir.c

Log Message:
- remove a wrong _DIAGASSERT
- update comments
- whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/gen/dirent_private.h
cvs rdiff -u -r1.35 -r1.36 src/lib/libc/gen/opendir.c
cvs rdiff -u -r1.24 -r1.25 src/lib/libc/gen/readdir.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/gen/dirent_private.h
diff -u src/lib/libc/gen/dirent_private.h:1.2 src/lib/libc/gen/dirent_private.h:1.3
--- src/lib/libc/gen/dirent_private.h:1.2	Sun May  4 18:53:26 2008
+++ src/lib/libc/gen/dirent_private.h	Thu Sep 16 02:38:50 2010
@@ -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 */
 };
 

Index: src/lib/libc/gen/opendir.c
diff -u src/lib/libc/gen/opendir.c:1.35 src/lib/libc/gen/opendir.c:1.36
--- src/lib/libc/gen/opendir.c:1.35	Sun Jan 11 02:46:27 2009
+++ src/lib/libc/gen/opendir.c	Thu Sep 16 02:38:50 2010
@@ -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;

Index: src/lib/libc/gen/readdir.c
diff -u src/lib/libc/gen/readdir.c:1.24 src/lib/libc/gen/readdir.c:1.25
--- src/lib/libc/gen/readdir.c:1.24	Sun May  4 18:53:26 2008
+++ src/lib/libc/gen/readdir.c	Thu Sep 16 02:38:50 2010
@@ -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)

Reply via email to