aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/ztest/ztest.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2011-07-06 11:36:54 -0700
committerBrian Behlendorf <[email protected]>2011-07-06 12:30:09 -0700
commit341b5f1d4c03c0f318218346154e2fb79a8acb92 (patch)
tree667464010db766cc83d4bfa6d16a0f1552f39a74 /cmd/ztest/ztest.c
parentb1c932d318ae604b6968ffef136952af4e80a407 (diff)
Update ztest paths
Unfortunately, ztest is hard coded to export the zdb utility to be installed in a certain location. When the packaging was updated to install zdb in /sbin/ ztest was broken. To fix this I'm updating ztest to check both common install paths.
Diffstat (limited to 'cmd/ztest/ztest.c')
-rw-r--r--cmd/ztest/ztest.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c
index f71053476..6acba5290 100644
--- a/cmd/ztest/ztest.c
+++ b/cmd/ztest/ztest.c
@@ -4910,8 +4910,10 @@ ztest_run_zdb(char *pool)
zbuf = umem_alloc(1024, UMEM_NOFAIL);
VERIFY(realpath(getexecname(), bin) != NULL);
- if (strncmp(bin, "/usr/sbin/ztest", 14) == 0) {
+ if (strncmp(bin, "/usr/sbin/ztest", 15) == 0) {
strcpy(bin, "/usr/sbin/zdb"); /* Installed */
+ } else if (strncmp(bin, "/sbin/ztest", 11) == 0) {
+ strcpy(bin, "/sbin/zdb"); /* Installed */
} else {
strstr(bin, "/ztest/")[0] = '\0'; /* In-tree */
strcat(bin, "/zdb/zdb");