X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=archival%2Fgunzip.c;h=7b939290b4b13e80234aca26a6eddbacc9449689;hb=44e216f2642ff4ea53026792e80df95df71e9905;hp=a4db7ca31e731317d3030f477c1499d2def221fa;hpb=b7128c6236ac9b4d5d69ad95d509498f38df0dd6;p=oweals%2Fbusybox.git diff --git a/archival/gunzip.c b/archival/gunzip.c index a4db7ca31..7b939290b 100644 --- a/archival/gunzip.c +++ b/archival/gunzip.c @@ -75,7 +75,7 @@ static char *license_msg[] = { #define GUNZIP_OPT_TEST 4 #define GUNZIP_OPT_DECOMPRESS 8 -extern int gunzip_main(int argc, char **argv) +int gunzip_main(int argc, char **argv) { char status = EXIT_SUCCESS; unsigned long opt; @@ -103,9 +103,7 @@ extern int gunzip_main(int argc, char **argv) src_fd = bb_xopen(old_path, O_RDONLY); /* Get the time stamp on the input file. */ - if (stat(old_path, &stat_buf) < 0) { - bb_error_msg_and_die("Couldn't stat file %s", old_path); - } + xstat(old_path, &stat_buf); } /* Check that the input is sane. */ @@ -116,7 +114,7 @@ extern int gunzip_main(int argc, char **argv) /* Set output filename and number */ if (opt & GUNZIP_OPT_TEST) { - dst_fd = bb_xopen("/dev/null", O_WRONLY); /* why does test use filenum 2 ? */ + dst_fd = bb_xopen(bb_dev_null, O_WRONLY); /* why does test use filenum 2 ? */ } else if (opt & GUNZIP_OPT_STDOUT) { dst_fd = STDOUT_FILENO; } else {