diff options
| author | yamt <yamt@NetBSD.org> | 2010-09-16 02:38:50 +0000 |
|---|---|---|
| committer | yamt <yamt@NetBSD.org> | 2010-09-16 02:38:50 +0000 |
| commit | 53cf9ce3bea11ecdca40251e09047d445b4a85d7 (patch) | |
| tree | fd04d02dbd1fdbdb0593c3392d46bf0e77692baf /lib/libc | |
| parent | b60c232a644edc1b2a3463c57bf989ceae97ecab (diff) | |
- remove a wrong _DIAGASSERT
- update comments
- whitespace
Diffstat (limited to 'lib/libc')
| -rw-r--r-- | lib/libc/gen/dirent_private.h | 8 | ||||
| -rw-r--r-- | lib/libc/gen/opendir.c | 13 | ||||
| -rw-r--r-- | lib/libc/gen/readdir.c | 5 |
3 files changed, 12 insertions, 14 deletions
diff --git a/lib/libc/gen/dirent_private.h b/lib/libc/gen/dirent_private.h index 613df3e2b91..f4043018c2a 100644 --- a/lib/libc/gen/dirent_private.h +++ b/lib/libc/gen/dirent_private.h @@ -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 --git a/lib/libc/gen/opendir.c b/lib/libc/gen/opendir.c index 32118a03973..ffd80231419 100644 --- a/lib/libc/gen/opendir.c +++ b/lib/libc/gen/opendir.c @@ -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 @@ __opendir_common(int fd, const char *name, int flags) 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 @@ __opendir_common(int fd, const char *name, int flags) * 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 @@ __opendir_common(int fd, const char *name, int flags) 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 @@ retry: do { /* * Always make at least DIRBLKSIZ bytes - * available to getdirentries + * available to getdents */ if (space < DIRBLKSIZ) { space += incr; diff --git a/lib/libc/gen/readdir.c b/lib/libc/gen/readdir.c index 1992748d9c0..13c3eb03493 100644 --- a/lib/libc/gen/readdir.c +++ b/lib/libc/gen/readdir.c @@ -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 @@ _readdir_unlocked(DIR *dirp, int skipdeleted) { struct dirent *dp; - for (;;) { if (dirp->dd_loc >= dirp->dd_size) { if (dirp->dd_flags & __DTF_READALL) |
