Date: Wed, 20 Nov 2013 01:42:30 +0000 (UTC) From: Justin Hibbits <jhibbits@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258362 - in head/cddl/contrib/opensolaris/cmd: plockstat zfs Message-ID: <201311200142.rAK1gU83069098@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhibbits Date: Wed Nov 20 01:42:29 2013 New Revision: 258362 URL: http://svnweb.freebsd.org/changeset/base/258362 Log: Use 'int' to store the return value of getopt(), rather than char. On some architectures (powerpc), char is unsigned by default, which means comparisons against -1 always fail, so the programs get stuck in an infinite loop. MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Modified: head/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c Wed Nov 20 01:33:13 2013 (r258361) +++ head/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c Wed Nov 20 01:42:29 2013 (r258362) @@ -778,7 +778,8 @@ main(int argc, char **argv) #endif int err; int opt_C = 0, opt_H = 0, opt_p = 0, opt_v = 0; - char c, *p, *end; + int c; + char *p, *end; struct sigaction act; int done = 0; Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Nov 20 01:33:13 2013 (r258361) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Nov 20 01:42:29 2013 (r258362) @@ -2011,7 +2011,7 @@ zfs_do_upgrade(int argc, char **argv) boolean_t showversions = B_FALSE; int ret = 0; upgrade_cbdata_t cb = { 0 }; - char c; + int c; int flags = ZFS_ITER_ARGS_CAN_BE_PATHS; /* check options */ @@ -3561,7 +3561,7 @@ static int zfs_do_snapshot(int argc, char **argv) { int ret = 0; - char c; + int c; nvlist_t *props; snap_cbdata_t sd = { 0 }; boolean_t multiple_snaps = B_FALSE;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201311200142.rAK1gU83069098>