diff options
author | Eric Andersen | 2004-07-26 09:11:12 +0000 |
---|---|---|
committer | Eric Andersen | 2004-07-26 09:11:12 +0000 |
commit | 4f807a84c5d936c931cd93c9e98d087305295a1c (patch) | |
tree | 46c3a59fa158ebbd7303454f2657c330abfc24fe /archival/libunarchive/get_header_cpio.c | |
parent | 5dcf15e02de10e648ac8e8d86500678f2043d2e6 (diff) | |
download | busybox-4f807a84c5d936c931cd93c9e98d087305295a1c.zip busybox-4f807a84c5d936c931cd93c9e98d087305295a1c.tar.gz |
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
Diffstat (limited to 'archival/libunarchive/get_header_cpio.c')
-rw-r--r-- | archival/libunarchive/get_header_cpio.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/archival/libunarchive/get_header_cpio.c b/archival/libunarchive/get_header_cpio.c index f72c376..11925c4 100644 --- a/archival/libunarchive/get_header_cpio.c +++ b/archival/libunarchive/get_header_cpio.c @@ -18,6 +18,7 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> +#include <sys/sysmacros.h> /* major() and minor() */ #include "unarchive.h" #include "libbb.h" @@ -143,7 +144,7 @@ extern char get_header_cpio(archive_handle_t *archive_handle) } } } - file_header->device = (major << 8) | minor; + file_header->device = makedev(major, minor); if (archive_handle->filter(archive_handle) == EXIT_SUCCESS) { archive_handle->action_data(archive_handle); |