Date: Wed, 15 Jan 2014 05:30:06 +0000 (UTC) From: Justin Hibbits <jhibbits@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r260671 - in stable/10/cddl/contrib/opensolaris/cmd: plockstat zfs Message-ID: <201401150530.s0F5U6Xr062256@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhibbits Date: Wed Jan 15 05:30:05 2014 New Revision: 260671 URL: http://svnweb.freebsd.org/changeset/base/260671 Log: MFC r258362 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. Modified: stable/10/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c Wed Jan 15 05:19:37 2014 (r260670) +++ stable/10/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c Wed Jan 15 05:30:05 2014 (r260671) @@ -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: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Jan 15 05:19:37 2014 (r260670) +++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Jan 15 05:30:05 2014 (r260671) @@ -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 */ @@ -3560,7 +3560,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?201401150530.s0F5U6Xr062256>