summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhibbits <jhibbits@FreeBSD.org>2014-01-15 05:30:05 +0000
committerjhibbits <jhibbits@FreeBSD.org>2014-01-15 05:30:05 +0000
commit04f97f623159b87e337b9f3663bc7512b83427e0 (patch)
tree96addc3762cc8776742e6beb128a89f86e6b76cf
parentb1391adbae9577879c598fce281eb1179d26142f (diff)
downloadFreeBSD-src-04f97f623159b87e337b9f3663bc7512b83427e0.zip
FreeBSD-src-04f97f623159b87e337b9f3663bc7512b83427e0.tar.gz
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.
-rw-r--r--cddl/contrib/opensolaris/cmd/plockstat/plockstat.c3
-rw-r--r--cddl/contrib/opensolaris/cmd/zfs/zfs_main.c4
2 files changed, 4 insertions, 3 deletions
diff --git a/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c b/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c
index aa2c1f9..1288468 100644
--- a/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c
+++ b/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c
@@ -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;
diff --git a/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c b/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
index a2d4973..e3bf7ca 100644
--- a/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
+++ b/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
@@ -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;
OpenPOWER on IntegriCloud