Changeset 1770 in MondoRescue for branches/stable/mindi-busybox/archival/cpio.c
- Timestamp:
- Nov 6, 2007, 11:01:53 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mindi-busybox/archival/cpio.c
r821 r1770 5 5 * Copyright (C) 2001 by Glenn McGrath 6 6 * 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. 20 8 * 21 9 * Limitations: … … 24 12 * 25 13 */ 26 #include <fcntl.h> 27 #include <stdlib.h> 28 #include <string.h> 29 #include <unistd.h> 14 #include "libbb.h" 30 15 #include "unarchive.h" 31 #include "busybox.h"32 16 33 #define CPIO_OPT_EXTRACT 34 #define CPIO_OPT_TEST 35 #define CPIO_OPT_UNCONDITIONAL 36 #define CPIO_OPT_VERBOSE 37 #define CPIO_OPT_FILE 38 #define CPIO_OPT_CREATE_LEADING_DIR 39 #define CPIO_OPT_PRESERVE_MTIME 17 #define CPIO_OPT_EXTRACT 0x01 18 #define CPIO_OPT_TEST 0x02 19 #define CPIO_OPT_UNCONDITIONAL 0x04 20 #define CPIO_OPT_VERBOSE 0x08 21 #define CPIO_OPT_FILE 0x10 22 #define CPIO_OPT_CREATE_LEADING_DIR 0x20 23 #define CPIO_OPT_PRESERVE_MTIME 0x40 40 24 25 int cpio_main(int argc, char **argv); 41 26 int cpio_main(int argc, char **argv) 42 27 { 43 28 archive_handle_t *archive_handle; 44 29 char *cpio_filename = NULL; 45 unsigned longopt;30 unsigned opt; 46 31 47 32 /* Initialise */ 48 33 archive_handle = init_handle(); 49 34 archive_handle->src_fd = STDIN_FILENO; 50 archive_handle->seek = seek_by_ char;35 archive_handle->seek = seek_by_read; 51 36 archive_handle->flags = ARCHIVE_EXTRACT_NEWER | ARCHIVE_PRESERVE_DATE; 52 37 53 opt = bb_getopt_ulflags(argc,argv, "ituvF:dm", &cpio_filename);38 opt = getopt32(argv, "ituvF:dm", &cpio_filename); 54 39 55 40 /* One of either extract or test options must be given */ … … 80 65 } 81 66 if (cpio_filename) { /* CPIO_OPT_FILE */ 82 archive_handle->src_fd = bb_xopen(cpio_filename, O_RDONLY);67 archive_handle->src_fd = xopen(cpio_filename, O_RDONLY); 83 68 archive_handle->seek = seek_by_jump; 84 69 } … … 95 80 while (get_header_cpio(archive_handle) == EXIT_SUCCESS); 96 81 97 return (EXIT_SUCCESS);82 return EXIT_SUCCESS; 98 83 }
Note:
See TracChangeset
for help on using the changeset viewer.