svn commit: r296436 - in stable/10/cddl/contrib/opensolaris/cmd: zfs zpool

Dimitry Andric dim at FreeBSD.org
Mon Mar 7 07:46:19 UTC 2016


Author: dim
Date: Mon Mar  7 07:46:17 2016
New Revision: 296436
URL: https://svnweb.freebsd.org/changeset/base/296436

Log:
  MFC r295844:
  
  Fix "invalid type '(null)'" usage messages in zfs(8) and zpool(8).
  
  Currently, zfs(8) and zpool(8) print "invalid type '(null)'" or similar
  messages, if you pass in invalid types, sources or column names for "zfs
  get", "zfs list" and "zpool get".  This is because the commands use
  getsubopt(3), and in case of failure, they print 'value', which is NULL
  when sub options don't match.
  
  They should print 'suboptarg' instead, which is the documented way to
  get at the non-matching sub option value.
  
  Reviewed by:	smh
  Differential Revision: https://reviews.freebsd.org/D5365

Modified:
  stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
  stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
==============================================================================
--- stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c	Sun Mar  6 21:32:54 2016	(r296435)
+++ stable/10/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c	Mon Mar  7 07:46:17 2016	(r296436)
@@ -1712,7 +1712,7 @@ zfs_do_get(int argc, char **argv)
 				default:
 					(void) fprintf(stderr,
 					    gettext("invalid column name "
-					    "'%s'\n"), value);
+					    "'%s'\n"), suboptarg);
 					usage(B_FALSE);
 				}
 			}
@@ -1749,7 +1749,7 @@ zfs_do_get(int argc, char **argv)
 				default:
 					(void) fprintf(stderr,
 					    gettext("invalid source "
-					    "'%s'\n"), value);
+					    "'%s'\n"), suboptarg);
 					usage(B_FALSE);
 				}
 			}
@@ -1785,7 +1785,7 @@ zfs_do_get(int argc, char **argv)
 				default:
 					(void) fprintf(stderr,
 					    gettext("invalid type '%s'\n"),
-					    value);
+					    suboptarg);
 					usage(B_FALSE);
 				}
 			}
@@ -3155,7 +3155,7 @@ zfs_do_list(int argc, char **argv)
 				default:
 					(void) fprintf(stderr,
 					    gettext("invalid type '%s'\n"),
-					    value);
+					    suboptarg);
 					usage(B_FALSE);
 				}
 			}

Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
==============================================================================
--- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c	Sun Mar  6 21:32:54 2016	(r296435)
+++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c	Mon Mar  7 07:46:17 2016	(r296436)
@@ -5431,7 +5431,7 @@ zpool_do_get(int argc, char **argv)
 				default:
 					(void) fprintf(stderr,
 					    gettext("invalid column name "
-					    "'%s'\n"), value);
+					    "'%s'\n"), suboptarg);
 					usage(B_FALSE);
 				}
 			}


More information about the svn-src-all mailing list