Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Dec 2002 00:49:07 -0500
From:      Mike Barcroft <mike@FreeBSD.org>
To:        Matthew Dillon <dillon@apollo.backplane.com>
Cc:        current@freebsd.org, ia64@freebsd.org
Subject:   Re: ia64 tinderbox failure
Message-ID:  <20021229004907.C98334@espresso.q9media.com>
In-Reply-To: <200212290527.gBT5R0qr085354@mckinley.corp.yahoo.com>; from peter@freebsd.org on Sat, Dec 28, 2002 at 09:27:00PM -0800
References:  <200212290527.gBT5R0qr085354@mckinley.corp.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Peter Wemm <peter@freebsd.org> writes:
> ===> sbin/swapon
> cc1: warnings being treated as errors
> /home/tinderbox/ia64/src/sbin/swapon/swapon.c: In function `swaplist':
> /home/tinderbox/ia64/src/sbin/swapon/swapon.c:246: warning: field width is not type int (arg 3)
> /home/tinderbox/ia64/src/sbin/swapon/swapon.c:246: warning: field width is not type int (arg 5)
> /home/tinderbox/ia64/src/sbin/swapon/swapon.c:265: warning: field width is not type int (arg 3)
> /home/tinderbox/ia64/src/sbin/swapon/swapon.c:265: warning: field width is not type int (arg 5)
> /home/tinderbox/ia64/src/sbin/swapon/swapon.c:274: warning: field width is not type int (arg 2)
> /home/tinderbox/ia64/src/sbin/swapon/swapon.c:274: warning: field width is not type int (arg 4)
> *** Error code 1

Proposed fix:

%%%
Index: swapon.c
===================================================================
RCS file: /work/repo/src/sbin/swapon/swapon.c,v
retrieving revision 1.14
diff -u -r1.14 swapon.c
--- swapon.c	28 Dec 2002 23:39:47 -0000	1.14
+++ swapon.c	29 Dec 2002 05:53:17 -0000
@@ -53,6 +53,7 @@
 #include <err.h>
 #include <errno.h>
 #include <fstab.h>
+#include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -210,8 +211,8 @@
 {
 	size_t mibsize, size;
 	struct xswdev xsw;
-	int mib[16], n, pagesize;
-	size_t hlen;
+	int hlen, mib[16], n, pagesize;
+	size_t hsize;
 	long blocksize;
 	long long total = 0;
 	long long used = 0;
@@ -229,7 +230,8 @@
 	    hlen = 10;
 	    break;
 	default:
-	    getbsize(&hlen, &blocksize);
+	    getbsize(&hsize, &blocksize);
+	    hlen = MIN(INT_MAX, hsize);
 	    break;
 	}
 	
%%%

BTW, the tabbing in this area of the source file is messed up.

Best regards,
Mike Barcroft

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ia64" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021229004907.C98334>