Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Aug 2016 08:44:22 +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-9@freebsd.org
Subject:   svn commit: r304114 - stable/9/cddl/contrib/opensolaris/cmd/zdb
Message-ID:  <201608150844.u7F8iMSS052544@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Mon Aug 15 08:44:22 2016
New Revision: 304114
URL: https://svnweb.freebsd.org/changeset/base/304114

Log:
  MFC r303084: 6391 Override default SPA config location via environment
  
  Note that there was a merge conflict because of an unmerged earlier
  change.

Modified:
  stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c
Directory Properties:
  stable/9/cddl/contrib/opensolaris/cmd/zdb/   (props changed)

Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==============================================================================
--- stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Mon Aug 15 08:20:37 2016	(r304113)
+++ stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Mon Aug 15 08:44:22 2016	(r304114)
@@ -3273,12 +3273,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, "bcdhilmM:suCDRSAFLXevp:t:U:P")) != -1) {
 		switch (c) {
 		case 'b':



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608150844.u7F8iMSS052544>