diff options
Diffstat (limited to 'lib/libc/gen/nftw.c')
-rw-r--r-- | lib/libc/gen/nftw.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/lib/libc/gen/nftw.c b/lib/libc/gen/nftw.c index 43110c1..a338e5a 100644 --- a/lib/libc/gen/nftw.c +++ b/lib/libc/gen/nftw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nftw.c,v 1.4 2004/07/07 16:05:23 millert Exp $ */ +/* $OpenBSD: nftw.c,v 1.7 2006/03/31 19:41:44 millert Exp $ */ /* * Copyright (c) 2003, 2004 Todd C. Miller <Todd.Miller@courtesan.com> @@ -20,12 +20,6 @@ * Materiel Command, USAF, under agreement number F39502-99-1-0512. */ -#if 0 -#if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$OpenBSD: nftw.c,v 1.4 2004/07/07 16:05:23 millert Exp $"; -#endif /* LIBC_SCCS and not lint */ -#endif - #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); @@ -34,7 +28,6 @@ __FBSDID("$FreeBSD$"); #include <errno.h> #include <fts.h> #include <ftw.h> -#include <limits.h> int nftw(const char *path, int (*fn)(const char *, const struct stat *, int, @@ -47,7 +40,7 @@ nftw(const char *path, int (*fn)(const char *, const struct stat *, int, int error = 0, ftsflags, fnflag, postorder, sverrno; /* XXX - nfds is currently unused */ - if (nfds < 1 || nfds > OPEN_MAX) { + if (nfds < 1) { errno = EINVAL; return (-1); } @@ -72,6 +65,8 @@ nftw(const char *path, int (*fn)(const char *, const struct stat *, int, continue; fnflag = FTW_D; break; + case FTS_DC: + continue; case FTS_DNR: fnflag = FTW_DNR; break; @@ -94,9 +89,6 @@ nftw(const char *path, int (*fn)(const char *, const struct stat *, int, case FTS_SLNONE: fnflag = FTW_SLN; break; - case FTS_DC: - errno = ELOOP; - /* FALLTHROUGH */ default: error = -1; goto done; |