summaryrefslogtreecommitdiff
path: root/archival/gunzip.c
diff options
context:
space:
mode:
authorDenis Vlasenko2006-10-12 20:06:18 +0000
committerDenis Vlasenko2006-10-12 20:06:18 +0000
commit9c267b851e54441b867293973fd5a898b847df39 (patch)
treec238cf9dfb9933506f7067011ac696794df1906a /archival/gunzip.c
parent98ae2160b62b99424e5793e97d5abd4e3c2e576b (diff)
downloadbusybox-9c267b851e54441b867293973fd5a898b847df39.zip
busybox-9c267b851e54441b867293973fd5a898b847df39.tar.gz
style fixes
Diffstat (limited to 'archival/gunzip.c')
-rw-r--r--archival/gunzip.c7
1 files changed, 3 insertions, 4 deletions
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 */