diff options
author | Cyril Plisko <cyril.plisko@mountall.com> | 2015-11-02 09:56:18 -0800 |
---|---|---|
committer | Matthew Ahrens <mahrens@delphix.com> | 2015-11-02 09:56:18 -0800 |
commit | ae24175b2b25e9fb4bfd9ac0648b57e0735b6651 (patch) | |
tree | 214b47d50453824554042a478cb0870dd33d4805 /usr/src | |
parent | 57deb2328260c447bf1db25fe74e0eece102733e (diff) | |
download | illumos-joyent-ae24175b2b25e9fb4bfd9ac0648b57e0735b6651.tar.gz |
6391 Override default SPA config location via environment
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Richard Yao <ryao@gentoo.org>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Will Andrews <will@freebsd.org>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/cmd/zdb/zdb.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/usr/src/cmd/zdb/zdb.c b/usr/src/cmd/zdb/zdb.c index 7c3ac73706..5746d6492a 100644 --- a/usr/src/cmd/zdb/zdb.c +++ b/usr/src/cmd/zdb/zdb.c @@ -3530,12 +3530,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) { |