From owner-svn-src-head@FreeBSD.ORG Thu Apr 24 01:12:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7165F5B3; Thu, 24 Apr 2014 01:12:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E0A91FEF; Thu, 24 Apr 2014 01:12:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3O1CrQ3043424; Thu, 24 Apr 2014 01:12:53 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3O1CrSl043423; Thu, 24 Apr 2014 01:12:53 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201404240112.s3O1CrSl043423@svn.freebsd.org> From: Steven Hartland Date: Thu, 24 Apr 2014 01:12:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264851 - head/cddl/contrib/opensolaris/cmd/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 01:12:53 -0000 Author: smh Date: Thu Apr 24 01:12:52 2014 New Revision: 264851 URL: http://svnweb.freebsd.org/changeset/base/264851 Log: Eliminated optarg global being used outside of the function which called getopt MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu Apr 24 01:06:03 2014 (r264850) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu Apr 24 01:12:52 2014 (r264851) @@ -495,9 +495,8 @@ usage(boolean_t requested) } static int -parseprop(nvlist_t *props) +parseprop(nvlist_t *props, char *propname) { - char *propname = optarg; char *propval, *strval; if ((propval = strchr(propname, '=')) == NULL) { @@ -526,7 +525,7 @@ parse_depth(char *opt, int *flags) depth = (int)strtol(opt, &tmp, 0); if (*tmp) { (void) fprintf(stderr, - gettext("%s is not an integer\n"), optarg); + gettext("%s is not an integer\n"), opt); usage(B_FALSE); } if (depth < 0) { @@ -617,7 +616,7 @@ zfs_do_clone(int argc, char **argv) while ((c = getopt(argc, argv, "o:p")) != -1) { switch (c) { case 'o': - if (parseprop(props)) + if (parseprop(props, optarg)) return (1); break; case 'p': @@ -767,7 +766,7 @@ zfs_do_create(int argc, char **argv) nomem(); break; case 'o': - if (parseprop(props)) + if (parseprop(props, optarg)) goto error; break; case 's': @@ -3636,7 +3635,7 @@ zfs_do_snapshot(int argc, char **argv) while ((c = getopt(argc, argv, "ro:")) != -1) { switch (c) { case 'o': - if (parseprop(props)) + if (parseprop(props, optarg)) return (1); break; case 'r':