summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Corsépius <corsepiu@fedoraproject.org>2007-10-28 07:30:58 +0100
committerRalf Corsépius <corsepiu@fedoraproject.org>2007-10-28 07:30:58 +0100
commit6a10fc88147ad7f55dab51565abe216852f8bd5c (patch)
tree683394c884fa31b442dda082616a91d7162b0450
parenta02ad3f220decc6a8e54fbf8e436f64ee0c07243 (diff)
downloadrpm-6a10fc88147ad7f55dab51565abe216852f8bd5c.tar.gz
rpm-6a10fc88147ad7f55dab51565abe216852f8bd5c.tar.bz2
rpm-6a10fc88147ad7f55dab51565abe216852f8bd5c.zip
Eliminate u_short, USHRT_MAX.
-rw-r--r--rpmio/fts.c12
-rw-r--r--rpmio/fts.h10
2 files changed, 11 insertions, 11 deletions
diff --git a/rpmio/fts.c b/rpmio/fts.c
index e193d7262..7d6cff199 100644
--- a/rpmio/fts.c
+++ b/rpmio/fts.c
@@ -92,7 +92,7 @@ static size_t fts_maxarglen(char * const * argv);
static void fts_padjust(FTS * sp, FTSENT * head);
static int fts_palloc(FTS * sp, size_t more);
static FTSENT * fts_sort(FTS * sp, FTSENT * head, int nitems);
-static u_short fts_stat(FTS * sp, FTSENT * p, int follow);
+static uint16_t fts_stat(FTS * sp, FTSENT * p, int follow);
static int fts_safe_changedir(FTS * sp, FTSENT * p, int fd,
const char * path);
@@ -764,9 +764,9 @@ mem1: saved_errno = errno;
maxlen = sp->fts_pathlen - len;
}
- if (len + _D_EXACT_NAMLEN (dp) >= USHRT_MAX) {
+ if (len + _D_EXACT_NAMLEN (dp) >= UINT16_MAX) {
/*
- * In an FTSENT, fts_pathlen is a u_short so it is
+ * In an FTSENT, fts_pathlen is a uint16_t so it is
* possible to wraparound here. If we do, free up
* the current structure and the structures already
* allocated, then error out with ENAMETOOLONG.
@@ -880,7 +880,7 @@ mem1: saved_errno = errno;
return (head);
}
-static u_short
+static uint16_t
fts_stat(FTS * sp, FTSENT * p, int follow)
{
register FTSENT *t;
@@ -1059,9 +1059,9 @@ fts_palloc(FTS * sp, size_t more)
/*
* Check for possible wraparound. In an FTS, fts_pathlen is
* a signed int but in an FTSENT it is an unsigned short.
- * We limit fts_pathlen to USHRT_MAX to be safe in both cases.
+ * We limit fts_pathlen to UINT16_MAX to be safe in both cases.
*/
- if (sp->fts_pathlen < 0 || sp->fts_pathlen >= USHRT_MAX) {
+ if (sp->fts_pathlen < 0 || sp->fts_pathlen >= UINT16_MAX) {
if (sp->fts_path) {
free(sp->fts_path);
sp->fts_path = NULL;
diff --git a/rpmio/fts.h b/rpmio/fts.h
index 9d982aebd..09e675b11 100644
--- a/rpmio/fts.h
+++ b/rpmio/fts.h
@@ -107,8 +107,8 @@ 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) */
+ uint16_t fts_pathlen; /*!< strlen(fts_path) */
+ uint16_t fts_namelen; /*!< strlen(fts_name) */
ino_t fts_ino; /*!< inode */
dev_t fts_dev; /*!< device */
@@ -132,17 +132,17 @@ typedef struct _ftsent {
#define FTS_SL 12 /* symbolic link */
#define FTS_SLNONE 13 /* symbolic link without target */
#define FTS_W 14 /* whiteout object */
- u_short fts_info; /*!< user flags for FTSENT structure */
+ uint16_t fts_info; /*!< user flags for FTSENT structure */
#define FTS_DONTCHDIR 0x01 /* don't chdir .. to the parent */
#define FTS_SYMFOLLOW 0x02 /* followed a symlink to get here */
- u_short fts_flags; /*!< private flags for FTSENT structure */
+ uint16_t fts_flags; /*!< private flags for FTSENT structure */
#define FTS_AGAIN 1 /* read node again */
#define FTS_FOLLOW 2 /* follow symbolic link */
#define FTS_NOINSTR 3 /* no instructions */
#define FTS_SKIP 4 /* discard node */
- u_short fts_instr; /*!< fts_set() instructions */
+ uint16_t fts_instr; /*!< fts_set() instructions */
struct stat *fts_statp; /*!< stat(2) information */
char fts_name[1]; /*!< file name */