summaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
Diffstat (limited to 'archival')
-rw-r--r--archival/bunzip2.c4
-rw-r--r--archival/gunzip.c7
2 files changed, 5 insertions, 6 deletions
diff --git a/archival/bunzip2.c b/archival/bunzip2.c
index 85f2343..757001f 100644
--- a/archival/bunzip2.c
+++ b/archival/bunzip2.c
@@ -37,8 +37,8 @@ int bunzip2_main(int argc, char **argv)
/* Check that the input is sane. */
if (isatty(src_fd) && (opt & BUNZIP2_OPT_FORCE) == 0) {
- bb_error_msg_and_die("Compressed data not read from terminal. "
- "Use -f to force it.");
+ bb_error_msg_and_die("compressed data not read from terminal, "
+ "use -f to force it");
}
if (filename) {
diff --git a/archival/gunzip.c b/archival/gunzip.c
index 396ce4f..e24401c 100644
--- a/archival/gunzip.c
+++ b/archival/gunzip.c
@@ -65,9 +65,8 @@ int gunzip_main(int argc, char **argv)
optind = argc; /* we don't handle "gunzip - a.gz b.gz" */
} else {
src_fd = xopen(old_path, O_RDONLY);
-
/* Get the time stamp on the input file. */
- xstat(old_path, &stat_buf);
+ fstat(src_fd, &stat_buf);
}
/* Check that the input is sane. */
@@ -131,11 +130,11 @@ int gunzip_main(int argc, char **argv)
}
else if (ENABLE_DESKTOP && (opt & GUNZIP_OPT_VERBOSE)) {
fprintf(stderr, "%s: %u%% - replaced with %s\n",
- // TODO: LARGEFILE support for stat_buf.st_size?
old_path, (unsigned)(stat_buf.st_size*100 / (status+1)), new_path);
}
} else {
- bb_error_msg("invalid magic"); exitcode = 1;
+ bb_error_msg("invalid magic");
+ exitcode = 1;
}
if (status < 0 && new_path) {
/* Unzip failed, remove new path instead of old path */