From 4f807a84c5d936c931cd93c9e98d087305295a1c Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Mon, 26 Jul 2004 09:11:12 +0000 Subject: BusyBox has no business hard coding the number of major and minor bits for a dev_t. This is especially important now that the user space concept of a dev_t and the kernel concept of a dev_t are divergant. The only bit of user space allowed to know the number of major and minor bits is include/sys/sysmacros.h (i.e. part of libc). When used with a current C library and a 2.6.x kernel, this fix should allow BusyBox to support wide device major/minor numbers. -Erik --- archival/libunarchive/get_header_tar.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'archival/libunarchive/get_header_tar.c') diff --git a/archival/libunarchive/get_header_tar.c b/archival/libunarchive/get_header_tar.c index 33f19c60a..1ad9ac5e5 100644 --- a/archival/libunarchive/get_header_tar.c +++ b/archival/libunarchive/get_header_tar.c @@ -121,8 +121,8 @@ extern char get_header_tar(archive_handle_t *archive_handle) file_header->mtime = strtol(tar.formated.mtime, NULL, 8); file_header->link_name = (tar.formated.linkname[0] != '\0') ? bb_xstrdup(tar.formated.linkname) : NULL; - file_header->device = (dev_t) ((strtol(tar.formated.devmajor, NULL, 8) << 8) + - strtol(tar.formated.devminor, NULL, 8)); + file_header->device = makedev(strtol(tar.formated.devmajor, NULL, 8), + strtol(tar.formated.devminor, NULL, 8)); /* Set bits 0-11 of the files mode */ file_header->mode = 07777 & strtol(tar.formated.mode, NULL, 8); -- cgit v1.2.3