Ignore:
Timestamp:
Nov 4, 2007, 3:16:40 AM (17 years ago)
Author:
Bruno Cornec
Message:

Update to busybox 1.7.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.5/mindi-busybox/archival/rpm2cpio.c

    r821 r1765  
    55 * Copyright (C) 2001 by Laurence Anderson
    66 *
    7  * This program is free software; you can redistribute it and/or modify
    8  * it under the terms of the GNU General Public License as published by
    9  * the Free Software Foundation; either version 2 of the License, or
    10  * (at your option) any later version.
    11  *
    12  * This program is distributed in the hope that it will be useful,
    13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    15  * General Public License for more details.
    16  *
    17  * You should have received a copy of the GNU General Public License
    18  * along with this program; if not, write to the Free Software
    19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
     7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
    208 */
    21 #include <sys/types.h>
    22 #include <netinet/in.h> /* For ntohl & htonl function */
    23 #include <fcntl.h>
    24 #include <unistd.h>
    25 #include <string.h>
    26 #include "busybox.h"
     9#include "libbb.h"
    2710#include "unarchive.h"
    2811
     
    5336    struct rpm_header header;
    5437
    55     bb_xread_all(rpm_fd, &header, sizeof(struct rpm_header));
     38    xread(rpm_fd, &header, sizeof(struct rpm_header));
    5639    if (strncmp((char *) &header.magic, RPM_HEADER_MAGIC, 3) != 0) {
    57         bb_error_msg_and_die("Invalid RPM header magic"); /* Invalid magic */
     40        bb_error_msg_and_die("invalid RPM header magic"); /* Invalid magic */
    5841    }
    5942    if (header.version != 1) {
    60         bb_error_msg_and_die("Unsupported RPM header version"); /* This program only supports v1 headers */
     43        bb_error_msg_and_die("unsupported RPM header version"); /* This program only supports v1 headers */
    6144    }
    6245    header.entries = ntohl(header.entries);
     
    6750
    6851/* No getopt required */
     52int rpm2cpio_main(int argc, char **argv);
    6953int rpm2cpio_main(int argc, char **argv)
    7054{
     
    7660        rpm_fd = STDIN_FILENO;
    7761    } else {
    78         rpm_fd = bb_xopen(argv[1], O_RDONLY);
     62        rpm_fd = xopen(argv[1], O_RDONLY);
    7963    }
    8064
    81     bb_xread_all(rpm_fd, &lead, sizeof(struct rpm_lead));
     65    xread(rpm_fd, &lead, sizeof(struct rpm_lead));
    8266    if (strncmp((char *) &lead.magic, RPM_MAGIC, 4) != 0) {
    83         bb_error_msg_and_die("Invalid RPM magic"); /* Just check the magic, the rest is irrelevant */
     67        bb_error_msg_and_die("invalid RPM magic"); /* Just check the magic, the rest is irrelevant */
    8468    }
    8569
     
    9175    skip_header(rpm_fd);
    9276
    93     bb_xread_all(rpm_fd, &magic, 2);
     77    xread(rpm_fd, &magic, 2);
    9478    if ((magic[0] != 0x1f) || (magic[1] != 0x8b)) {
    95         bb_error_msg_and_die("Invalid gzip magic");
     79        bb_error_msg_and_die("invalid gzip magic");
    9680    }
    9781
    98     check_header_gzip(rpm_fd);
    99     if (inflate_gunzip(rpm_fd, STDOUT_FILENO) != 0) {
    100         bb_error_msg("Error inflating");
     82    check_header_gzip_or_die(rpm_fd);
     83    if (unpack_gz_stream(rpm_fd, STDOUT_FILENO) < 0) {
     84        bb_error_msg("error inflating");
    10185    }
    10286
Note: See TracChangeset for help on using the changeset viewer.