ztest: fix in-tree detection for automatic zdb path

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13316
This commit is contained in:
наб 2022-05-03 12:22:30 +02:00 committed by Brian Behlendorf
parent c6a5d7d997
commit e8ca724393

View File

@ -6639,9 +6639,9 @@ ztest_get_zdb_bin(char *bin, int len)
} }
VERIFY3P(realpath(getexecname(), bin), !=, NULL); VERIFY3P(realpath(getexecname(), bin), !=, NULL);
if (strstr(bin, "/ztest/")) { if (strstr(bin, ".libs/ztest")) {
strstr(bin, "/ztest/")[0] = '\0'; /* In-tree */ strstr(bin, ".libs/ztest")[0] = '\0'; /* In-tree */
strcat(bin, "/zdb/zdb"); strcat(bin, "zdb");
if (ztest_check_path(bin)) if (ztest_check_path(bin))
return; return;
} }