Date: Mon, 15 Aug 2016 08:45:14 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304116 - stable/11/cddl/contrib/opensolaris/cmd/zdb Message-ID: <201608150845.u7F8jEbg052684@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Mon Aug 15 08:45:13 2016 New Revision: 304116 URL: https://svnweb.freebsd.org/changeset/base/304116 Log: MFC r303084: 6391 Override default SPA config location via environment Modified: stable/11/cddl/contrib/opensolaris/cmd/zdb/zdb.c Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Aug 15 08:44:48 2016 (r304115) +++ stable/11/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Aug 15 08:45:13 2016 (r304116) @@ -3558,12 +3558,22 @@ main(int argc, char **argv) nvlist_t *policy = NULL; uint64_t max_txg = UINT64_MAX; int rewind = ZPOOL_NEVER_REWIND; + char *spa_config_path_env; (void) setrlimit(RLIMIT_NOFILE, &rl); (void) enable_extended_FILE_stdio(-1, -1); dprintf_setup(&argc, argv); + /* + * If there is an environment variable SPA_CONFIG_PATH it overrides + * default spa_config_path setting. If -U flag is specified it will + * override this environment variable settings once again. + */ + spa_config_path_env = getenv("SPA_CONFIG_PATH"); + if (spa_config_path_env != NULL) + spa_config_path = spa_config_path_env; + while ((c = getopt(argc, argv, "bcdhilmMI:suCDRSAFLXx:evp:t:U:P")) != -1) { switch (c) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608150845.u7F8jEbg052684>