Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 May 2009 22:41:28 +0000 (UTC)
From:      Stacey Son <sson@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r192937 - head/cddl/contrib/opensolaris/cmd/lockstat
Message-ID:  <200905272241.n4RMfSv9014325@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sson
Date: Wed May 27 22:41:28 2009
New Revision: 192937
URL: http://svn.freebsd.org/changeset/base/192937

Log:
  Fix lockstat breakage to arm/powerpc buildworld.
  Thanks to IBM char's are unsigned on arm/powerpc.
  
  Approved by:	gnn (mentor)

Modified:
  head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c

Modified: head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c	Wed May 27 22:23:16 2009	(r192936)
+++ head/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c	Wed May 27 22:41:28 2009	(r192937)
@@ -46,14 +46,18 @@
 #include <signal.h>
 #include <assert.h>
 
-#if !defined(sun)
-/* needed for FreeBSD */ 
+#if defined(sun)
+#define	GETOPT_EOF	EOF
+#else
+/* FreeBSD */ 
 #include <sys/time.h>
 #include <sys/resource.h>
-typedef uintptr_t pc_t;
 
-#define mergesort(a, b, c, d)	lsmergesort(a, b, c, d)
-#endif
+#define	mergesort(a, b, c, d)	lsmergesort(a, b, c, d)
+#define	GETOPT_EOF		(-1)
+
+typedef	uintptr_t	pc_t;
+#endif /* defined(sun) */
 
 #define	LOCKSTAT_OPTSTR	"x:bths:n:d:i:l:f:e:ckwWgCHEATID:RpPo:V"
 
@@ -1059,7 +1063,7 @@ main(int argc, char **argv)
 	char *data_buf;
 	lsrec_t *lsp, **current, **first, **sort_buf, **merge_buf;
 	FILE *out = stdout;
-	char c;
+	int c;
 	pid_t child;
 	int status;
 	int i, j;
@@ -1092,7 +1096,7 @@ main(int argc, char **argv)
 
 	g_nrecs = DEFAULT_NRECS;
 
-	while ((c = getopt(argc, argv, LOCKSTAT_OPTSTR)) != EOF) {
+	while ((c = getopt(argc, argv, LOCKSTAT_OPTSTR)) != GETOPT_EOF) {
 		switch (c) {
 		case 'b':
 			g_recsize = LS_BASIC;
@@ -1386,7 +1390,7 @@ main(int argc, char **argv)
 		dfail("failed to set 'statusrate'");
 
 	optind = 1;
-	while ((c = getopt(argc, argv, LOCKSTAT_OPTSTR)) != EOF) {
+	while ((c = getopt(argc, argv, LOCKSTAT_OPTSTR)) != GETOPT_EOF) {
 		switch (c) {
 		case 'x':
 			if ((p = strchr(optarg, '=')) != NULL)



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