diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2009-08-27 16:19:28 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2009-08-27 16:19:28 +0000 |
commit | b7f5ad085124a99744ae40715274e883f8461659 (patch) | |
tree | f194ede5673cdb211dba854b336abc74df3abad7 /include/fts.h | |
parent | bf2e754350c1fb7e3b93a2dc42e445c7055f1d1e (diff) |
Don't stop traversing a directory hierarchy if we reach SHRT_MAX,
just stop updating fts_level so we don't overflow it. This allows
rm, find, etc to operate on very deep hierarchies. Consumers of
fts(3) do need to be aware that the actual level may be larger
than fts_level. During the next libc major bump we will make
fts_level an int instead of a short. OK deraadt@
Diffstat (limited to 'include/fts.h')
-rw-r--r-- | include/fts.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/fts.h b/include/fts.h index 825fc5abfe8..da26a8823ee 100644 --- a/include/fts.h +++ b/include/fts.h @@ -1,4 +1,4 @@ -/* $OpenBSD: fts.h,v 1.11 2005/06/17 20:36:55 millert Exp $ */ +/* $OpenBSD: fts.h,v 1.12 2009/08/27 16:19:27 millert Exp $ */ /* $NetBSD: fts.h,v 1.5 1994/12/28 01:41:50 mycroft Exp $ */ /* @@ -79,6 +79,7 @@ typedef struct _ftsent { #define FTS_ROOTPARENTLEVEL -1 #define FTS_ROOTLEVEL 0 +#define FTS_MAXLEVEL 0x7fff short fts_level; /* depth (-1 to N) */ #define FTS_D 1 /* preorder directory */ |