summaryrefslogtreecommitdiffstats
path: root/usr.bin/gzip
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2009-06-19 19:28:21 +0000
committerdelphij <delphij@FreeBSD.org>2009-06-19 19:28:21 +0000
commitaed2d90f2622ec4c64bf8576250ad0f4a54dd094 (patch)
tree26b24deb4f8733e9119e7750af2b376cabec7fb8 /usr.bin/gzip
parente271e202d0e5e61bf8424c4ab9c4fd479a82649f (diff)
downloadFreeBSD-src-aed2d90f2622ec4c64bf8576250ad0f4a54dd094.zip
FreeBSD-src-aed2d90f2622ec4c64bf8576250ad0f4a54dd094.tar.gz
Two fixes for SMALL case when compiling with WARNS=6:
- Reduce scope where return value can be referenced. - Add a dummy access to timestamp to silence warning. Submitted by: Mingyan Guo <guomingyan gmail com>
Diffstat (limited to 'usr.bin/gzip')
-rw-r--r--usr.bin/gzip/gzip.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/gzip/gzip.c b/usr.bin/gzip/gzip.c
index 5a8e388..e33acc8 100644
--- a/usr.bin/gzip/gzip.c
+++ b/usr.bin/gzip/gzip.c
@@ -1297,7 +1297,7 @@ file_uncompress(char *file, char *outfile, size_t outsize)
ssize_t rbytes;
unsigned char header1[4];
enum filetype method;
- int rv, fd, ofd, zfd = -1;
+ int fd, ofd, zfd = -1;
#ifndef SMALL
time_t timestamp = 0;
unsigned char name[PATH_MAX + 1];
@@ -1344,6 +1344,7 @@ file_uncompress(char *file, char *outfile, size_t outsize)
#ifndef SMALL
if (method == FT_GZIP && Nflag) {
unsigned char ts[4]; /* timestamp */
+ int rv;
rv = pread(fd, ts, sizeof ts, GZIP_TIMESTAMP);
if (rv >= 0 && (size_t)rv < sizeof ts)
@@ -1966,6 +1967,8 @@ print_list(int fd, off_t out, const char *outfile, time_t ts)
}
in_tot += in;
out_tot += out;
+#else
+ (void)&ts; /* XXX */
#endif
printf("%12llu %12llu ", (unsigned long long)out, (unsigned long long)in);
print_ratio(in, out, stdout);
OpenPOWER on IntegriCloud