diff options
author | kientzle <kientzle@FreeBSD.org> | 2004-06-27 18:38:13 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2004-06-27 18:38:13 +0000 |
commit | 7cfb61a9b9d4d229afc86b347be4b4f696159b61 (patch) | |
tree | 028a85142b5dcf820d4a79533ebb325b81e54117 /lib/libarchive/archive_entry.c | |
parent | 34ed55636f92a39a90a92eadbea5f89e0b642b23 (diff) | |
download | FreeBSD-src-7cfb61a9b9d4d229afc86b347be4b4f696159b61.zip FreeBSD-src-7cfb61a9b9d4d229afc86b347be4b4f696159b61.tar.gz |
Clean up some consistent confusion between "dev" and "rdev."
Mostly, these were being used correctly even though a lot of
variables and function names were mis-named.
In the process, I found and fixed a couple of latent bugs and
added a guard against adding an archive to itself.
Diffstat (limited to 'lib/libarchive/archive_entry.c')
-rw-r--r-- | lib/libarchive/archive_entry.c | 72 |
1 files changed, 44 insertions, 28 deletions
diff --git a/lib/libarchive/archive_entry.c b/lib/libarchive/archive_entry.c index dfea3d3..0007e7a 100644 --- a/lib/libarchive/archive_entry.c +++ b/lib/libarchive/archive_entry.c @@ -339,16 +339,9 @@ archive_entry_new(void) */ dev_t -archive_entry_devmajor(struct archive_entry *entry) +archive_entry_dev(struct archive_entry *entry) { - return (major(entry->ae_stat.st_rdev)); -} - - -dev_t -archive_entry_devminor(struct archive_entry *entry) -{ - return (minor(entry->ae_stat.st_rdev)); + return (entry->ae_stat.st_dev); } void @@ -403,13 +396,18 @@ archive_entry_hardlink(struct archive_entry *entry) return (aes_get_mbs(&entry->ae_hardlink)); } +ino_t +archive_entry_ino(struct archive_entry *entry) +{ + return (entry->ae_stat.st_ino); +} + mode_t archive_entry_mode(struct archive_entry *entry) { return (entry->ae_stat.st_mode); } - time_t archive_entry_mtime(struct archive_entry *entry) { @@ -434,6 +432,24 @@ archive_entry_pathname_w(struct archive_entry *entry) return (aes_get_wcs(&entry->ae_pathname)); } +dev_t +archive_entry_rdev(struct archive_entry *entry) +{ + return (entry->ae_stat.st_rdev); +} + +dev_t +archive_entry_rdevmajor(struct archive_entry *entry) +{ + return (major(entry->ae_stat.st_rdev)); +} + +dev_t +archive_entry_rdevminor(struct archive_entry *entry) +{ + return (minor(entry->ae_stat.st_rdev)); +} + int64_t archive_entry_size(struct archive_entry *entry) { @@ -473,24 +489,6 @@ archive_entry_copy_stat(struct archive_entry *entry, const struct stat *st) } void -archive_entry_set_devmajor(struct archive_entry *entry, dev_t m) -{ - dev_t d; - - d = entry->ae_stat.st_rdev; - entry->ae_stat.st_rdev = makedev(m, minor(d)); -} - -void -archive_entry_set_devminor(struct archive_entry *entry, dev_t m) -{ - dev_t d; - - d = entry->ae_stat.st_rdev; - entry->ae_stat.st_rdev = makedev( major(d), m); -} - -void archive_entry_set_fflags(struct archive_entry *entry, unsigned long set, unsigned long clear) { @@ -573,6 +571,24 @@ archive_entry_copy_pathname_w(struct archive_entry *entry, const wchar_t *name) } void +archive_entry_set_rdevmajor(struct archive_entry *entry, dev_t m) +{ + dev_t d; + + d = entry->ae_stat.st_rdev; + entry->ae_stat.st_rdev = makedev(m, minor(d)); +} + +void +archive_entry_set_rdevminor(struct archive_entry *entry, dev_t m) +{ + dev_t d; + + d = entry->ae_stat.st_rdev; + entry->ae_stat.st_rdev = makedev( major(d), m); +} + +void archive_entry_set_size(struct archive_entry *entry, int64_t s) { entry->ae_stat.st_size = s; |