zhack: fix getopt return type

This fixes zhack's command processing on ARM.  On ARM char
is unsigned, and so, in promotion to an int, it will never
compare equal to -1.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Nathaniel Wesley Filardo <nwf@cs.jhu.edu>
Closes #7016
This commit is contained in:
Nathaniel Wesley Filardo 2018-01-09 14:14:45 -05:00 committed by Tony Hutter
parent 9c1a8eaa51
commit a2ee6568c6
1 changed files with 3 additions and 3 deletions

View File

@ -268,7 +268,7 @@ zhack_feature_enable_sync(void *arg, dmu_tx_t *tx)
static void
zhack_do_feature_enable(int argc, char **argv)
{
char c;
int c;
char *desc, *target;
spa_t *spa;
objset_t *mos;
@ -363,7 +363,7 @@ feature_decr_sync(void *arg, dmu_tx_t *tx)
static void
zhack_do_feature_ref(int argc, char **argv)
{
char c;
int c;
char *target;
boolean_t decr = B_FALSE;
spa_t *spa;
@ -483,7 +483,7 @@ main(int argc, char **argv)
char *path[MAX_NUM_PATHS];
const char *subcommand;
int rv = 0;
char c;
int c;
g_importargs.path = path;