summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-10-02 17:33:42 +0000
committerJim Meyering <jim@meyering.net>2003-10-02 17:33:42 +0000
commitcaf4f07912fe60253c65f8b3c3ba77290d4cc607 (patch)
tree6621d1ba67f97db9a9fccddcfe3a6517f13f3650 /lib
parent2d854fdf1ba60861e32e7266a888ec441cfb02a2 (diff)
downloadcoreutils-caf4f07912fe60253c65f8b3c3ba77290d4cc607.tar.xz
Don't require that the maximum length of a file name
encountered in a traversal fit in an `unsigned short', and fix some portability bugs (don't depend on gcc). [FTS] (fts_pathlen): Change type from int to size_t. [FTSENT] (fts_pathlen): Change type from u_short to size_t. (fts_level): Change type from u_short to int.
Diffstat (limited to 'lib')
-rw-r--r--lib/fts_.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/fts_.h b/lib/fts_.h
index 274aa95da..c8c3cd073 100644
--- a/lib/fts_.h
+++ b/lib/fts_.h
@@ -35,7 +35,6 @@
# include <features.h>
# include <sys/types.h>
-
typedef struct {
struct _ftsent *fts_cur; /* current node */
struct _ftsent *fts_child; /* linked list of children */
@@ -43,7 +42,7 @@ typedef struct {
dev_t fts_dev; /* starting device # */
char *fts_path; /* path for this descent */
int fts_rfd; /* fd for root */
- int fts_pathlen; /* sizeof(path) */
+ size_t fts_pathlen; /* sizeof(path) */
int fts_nitems; /* elements in the sort array */
int (*fts_compar) (const void *, const void *); /* compare fn */
@@ -75,8 +74,7 @@ typedef struct _ftsent {
char *fts_path; /* root path */
int fts_errno; /* errno for this node */
int fts_symfd; /* fd for symlink */
- u_short fts_pathlen; /* strlen(fts_path) */
- u_short fts_namelen; /* strlen(fts_name) */
+ size_t fts_pathlen; /* strlen(fts_path) */
ino_t fts_ino; /* inode */
dev_t fts_dev; /* device */
@@ -84,15 +82,17 @@ typedef struct _ftsent {
# define FTS_ROOTPARENTLEVEL -1
# define FTS_ROOTLEVEL 0
- short fts_level; /* depth (-1 to N) */
+ int fts_level; /* depth (-1 to N) */
+
+ u_short fts_namelen; /* strlen(fts_name) */
# define FTS_D 1 /* preorder directory */
# define FTS_DC 2 /* directory that causes cycles */
# define FTS_DEFAULT 3 /* none of the above */
-# define FTS_DNR 4 /* unreadable directory */
-# define FTS_DOT 5 /* dot or dot-dot */
+# define FTS_DNR 4 /* unreadable directory */
+# define FTS_DOT 5 /* dot or dot-dot */
# define FTS_DP 6 /* postorder directory */
-# define FTS_ERR 7 /* error; errno is set */
+# define FTS_ERR 7 /* error; errno is set */
# define FTS_F 8 /* regular file */
# define FTS_INIT 9 /* initialized only */
# define FTS_NS 10 /* stat(2) failed */