diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-02-05 12:58:05 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-02-05 12:58:05 +0200 |
commit | e5116e43d753114f9966ff42f507310a61f620eb (patch) | |
tree | a28fcaae0bb5346cc69eeb7a0e1641403facdff9 | |
parent | e7ac5fb183c4c0e5762d7f18c1c19c03fcdc2b3c (diff) | |
download | rpm-e5116e43d753114f9966ff42f507310a61f620eb.tar.gz rpm-e5116e43d753114f9966ff42f507310a61f620eb.tar.bz2 rpm-e5116e43d753114f9966ff42f507310a61f620eb.zip |
Add rpm_rdev_t type for rdev entries
- rdev is 16bit whereas dev is 32bit, eww...
-rw-r--r-- | build/files.c | 4 | ||||
-rw-r--r-- | lib/rpmfi.c | 6 | ||||
-rw-r--r-- | lib/rpmfi.h | 2 | ||||
-rw-r--r-- | lib/rpmfi_internal.h | 2 | ||||
-rw-r--r-- | lib/rpmtypes.h | 1 | ||||
-rw-r--r-- | lib/verify.c | 4 |
6 files changed, 10 insertions, 9 deletions
diff --git a/build/files.c b/build/files.c index 985830a1b..0709d9b3e 100644 --- a/build/files.c +++ b/build/files.c @@ -1153,8 +1153,8 @@ static void genCpioListAndHeader(FileList fl, (void) headerAddOrAppendEntry(h, RPMTAG_FILEMODES, RPM_INT16_TYPE, &(flp->fl_mode), 1); } - if (sizeof(flp->fl_rdev) != sizeof(uint16_t)) { - uint16_t prdev = (uint16_t)flp->fl_rdev; + if (sizeof(flp->fl_rdev) != sizeof(rpm_rdev_t)) { + rpm_rdev_t prdev = (rpm_rdev_t)flp->fl_rdev; (void) headerAddOrAppendEntry(h, RPMTAG_FILERDEVS, RPM_INT16_TYPE, &(prdev), 1); } else { diff --git a/lib/rpmfi.c b/lib/rpmfi.c index 0dd597137..d476865c9 100644 --- a/lib/rpmfi.c +++ b/lib/rpmfi.c @@ -204,9 +204,9 @@ rpm_off_t rpmfiFSize(rpmfi fi) return fsize; } -uint16_t rpmfiFRdev(rpmfi fi) +rpm_rdev_t rpmfiFRdev(rpmfi fi) { - uint16_t frdev = 0; + rpm_rdev_t frdev = 0; if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) { if (fi->frdevs != NULL) @@ -299,7 +299,7 @@ uint32_t rpmfiFNlink(rpmfi fi) /* XXX rpm-2.3.12 has not RPMTAG_FILEINODES */ if (fi->finodes && fi->frdevs) { uint32_t finode = fi->finodes[fi->i]; - uint16_t frdev = fi->frdevs[fi->i]; + rpm_rdev_t frdev = fi->frdevs[fi->i]; int j; for (j = 0; j < fi->fc; j++) { diff --git a/lib/rpmfi.h b/lib/rpmfi.h index 077601a0e..c6f40e421 100644 --- a/lib/rpmfi.h +++ b/lib/rpmfi.h @@ -230,7 +230,7 @@ rpm_off_t rpmfiFSize(rpmfi fi); * @param fi file info set * @return current file rdev, 0 on invalid */ -uint16_t rpmfiFRdev(rpmfi fi); +rpm_rdev_t rpmfiFRdev(rpmfi fi); /** \ingroup rpmfi * Return current file inode from file info set. diff --git a/lib/rpmfi_internal.h b/lib/rpmfi_internal.h index c036b7d2b..cf4e46f03 100644 --- a/lib/rpmfi_internal.h +++ b/lib/rpmfi_internal.h @@ -49,7 +49,7 @@ struct rpmfi_s { /*?null?*/ rpm_mode_t * fmodes; /*!< File mode(s) (from header) */ /*?null?*/ - const uint16_t * frdevs; /*!< File rdev(s) (from header) */ + const rpm_rdev_t * frdevs; /*!< File rdev(s) (from header) */ /*?null?*/ const uint32_t * finodes; /*!< File inodes(s) (from header) */ diff --git a/lib/rpmtypes.h b/lib/rpmtypes.h index 18ab753d6..56b6661de 100644 --- a/lib/rpmtypes.h +++ b/lib/rpmtypes.h @@ -29,6 +29,7 @@ typedef uint32_t rpm_color_t; typedef uint32_t rpm_off_t; typedef uint32_t rpm_time_t; typedef uint16_t rpm_mode_t; +typedef uint16_t rpm_rdev_t; typedef struct headerToken_s * Header; typedef struct headerIterator_s * HeaderIterator; diff --git a/lib/verify.c b/lib/verify.c index b8ec7b36c..67b7b5170 100644 --- a/lib/verify.c +++ b/lib/verify.c @@ -173,8 +173,8 @@ int rpmVerifyFile(const rpmts ts, const rpmfi fi, { *res |= RPMVERIFY_RDEV; } else if (S_ISDEV(fmode) && S_ISDEV(sb.st_mode)) { - uint16_t st_rdev = (sb.st_rdev & 0xffff); - uint16_t frdev = (rpmfiFRdev(fi) & 0xffff); + rpm_rdev_t st_rdev = (sb.st_rdev & 0xffff); + rpm_rdev_t frdev = (rpmfiFRdev(fi) & 0xffff); if (st_rdev != frdev) *res |= RPMVERIFY_RDEV; } |