svn commit: r194508 - head/usr.bin/gzip

Xin LI delphij at FreeBSD.org
Fri Jun 19 19:28:22 UTC 2009


Author: delphij
Date: Fri Jun 19 19:28:21 2009
New Revision: 194508
URL: http://svn.freebsd.org/changeset/base/194508

Log:
  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>

Modified:
  head/usr.bin/gzip/gzip.c

Modified: head/usr.bin/gzip/gzip.c
==============================================================================
--- head/usr.bin/gzip/gzip.c	Fri Jun 19 19:16:35 2009	(r194507)
+++ head/usr.bin/gzip/gzip.c	Fri Jun 19 19:28:21 2009	(r194508)
@@ -1297,7 +1297,7 @@ file_uncompress(char *file, char *outfil
 	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 *outfil
 #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
 	}
 	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);


More information about the svn-src-head mailing list