]> Zhao Yanbai Git Server - minix.git/commitdiff
gzip: fix warning messages with off_t
authorAntoine Leca <Antoine.Leca.1@gmail.com>
Mon, 7 Jan 2013 11:07:29 +0000 (11:07 +0000)
committerBen Gras <ben@minix3.org>
Tue, 8 Jan 2013 15:59:10 +0000 (15:59 +0000)
NetBSD assumes off_t is 64-bit, but on MINIX it is still 32-bit.
So cast the calls to use big_off_t, as stat(2) uses.
Only used in warning messages, was not a real production bug.

usr.bin/gzip/gzip.c

index 886ff5b27f5fcd9780666602d15273c22a5d6c38..00cbd82d2ede3acac19590e2b4b3fc291d89fbed 100644 (file)
@@ -1278,7 +1278,11 @@ file_compress(char *file, char *outfile, size_t outsize)
        if (osb.st_size != size) {
                maybe_warnx("output file: %s wrong size (%" PRIdOFF
                                " != %" PRIdOFF "), deleting",
+#ifndef __minix
                                outfile, osb.st_size, size);
+#else
+                               outfile, osb.st_size, (big_off_t)size);
+#endif
                goto bad_outfile;
        }
 
@@ -1557,7 +1561,11 @@ file_uncompress(char *file, char *outfile, size_t outsize)
        if (osb.st_size != size) {
                maybe_warnx("stat gave different size: %" PRIdOFF
                                " != %" PRIdOFF " (leaving original)",
+#ifndef __minix
                                size, osb.st_size);
+#else
+                               (big_off_t)size, osb.st_size);
+#endif
                close(ofd);
                unlink(outfile);
                return -1;