diff options
Diffstat (limited to 'archival/rpm2cpio.c')
-rw-r--r-- | archival/rpm2cpio.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/archival/rpm2cpio.c b/archival/rpm2cpio.c index 66f680869..bb9f69573 100644 --- a/archival/rpm2cpio.c +++ b/archival/rpm2cpio.c | |||
@@ -52,12 +52,12 @@ void skip_header(int rpm_fd) | |||
52 | { | 52 | { |
53 | struct rpm_header header; | 53 | struct rpm_header header; |
54 | 54 | ||
55 | xread_all(rpm_fd, &header, sizeof(struct rpm_header)); | 55 | bb_xread_all(rpm_fd, &header, sizeof(struct rpm_header)); |
56 | if (strncmp((char *) &header.magic, RPM_HEADER_MAGIC, 3) != 0) { | 56 | if (strncmp((char *) &header.magic, RPM_HEADER_MAGIC, 3) != 0) { |
57 | error_msg_and_die("Invalid RPM header magic"); /* Invalid magic */ | 57 | bb_error_msg_and_die("Invalid RPM header magic"); /* Invalid magic */ |
58 | } | 58 | } |
59 | if (header.version != 1) { | 59 | if (header.version != 1) { |
60 | error_msg_and_die("Unsupported RPM header version"); /* This program only supports v1 headers */ | 60 | bb_error_msg_and_die("Unsupported RPM header version"); /* This program only supports v1 headers */ |
61 | } | 61 | } |
62 | header.entries = ntohl(header.entries); | 62 | header.entries = ntohl(header.entries); |
63 | header.size = ntohl(header.size); | 63 | header.size = ntohl(header.size); |
@@ -75,12 +75,12 @@ extern int rpm2cpio_main(int argc, char **argv) | |||
75 | if (argc == 1) { | 75 | if (argc == 1) { |
76 | rpm_fd = fileno(stdin); | 76 | rpm_fd = fileno(stdin); |
77 | } else { | 77 | } else { |
78 | rpm_fd = xopen(argv[1], O_RDONLY); | 78 | rpm_fd = bb_xopen(argv[1], O_RDONLY); |
79 | } | 79 | } |
80 | 80 | ||
81 | xread_all(rpm_fd, &lead, sizeof(struct rpm_lead)); | 81 | bb_xread_all(rpm_fd, &lead, sizeof(struct rpm_lead)); |
82 | if (strncmp((char *) &lead.magic, RPM_MAGIC, 4) != 0) { | 82 | if (strncmp((char *) &lead.magic, RPM_MAGIC, 4) != 0) { |
83 | error_msg_and_die("Invalid RPM magic"); /* Just check the magic, the rest is irrelevant */ | 83 | bb_error_msg_and_die("Invalid RPM magic"); /* Just check the magic, the rest is irrelevant */ |
84 | } | 84 | } |
85 | 85 | ||
86 | /* Skip the signature header */ | 86 | /* Skip the signature header */ |
@@ -90,14 +90,14 @@ extern int rpm2cpio_main(int argc, char **argv) | |||
90 | /* Skip the main header */ | 90 | /* Skip the main header */ |
91 | skip_header(rpm_fd); | 91 | skip_header(rpm_fd); |
92 | 92 | ||
93 | xread_all(rpm_fd, &magic, 2); | 93 | bb_xread_all(rpm_fd, &magic, 2); |
94 | if ((magic[0] != 0x1f) || (magic[1] != 0x8b)) { | 94 | if ((magic[0] != 0x1f) || (magic[1] != 0x8b)) { |
95 | error_msg_and_die("Invalid gzip magic"); | 95 | bb_error_msg_and_die("Invalid gzip magic"); |
96 | } | 96 | } |
97 | 97 | ||
98 | check_header_gzip(rpm_fd); | 98 | check_header_gzip(rpm_fd); |
99 | if (inflate(rpm_fd, fileno(stdout)) != 0) { | 99 | if (inflate(rpm_fd, fileno(stdout)) != 0) { |
100 | error_msg("Error inflating"); | 100 | bb_error_msg("Error inflating"); |
101 | } | 101 | } |
102 | check_trailer_gzip(rpm_fd); | 102 | check_trailer_gzip(rpm_fd); |
103 | 103 | ||