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);
if (strstr(bin, "/ztest/")) {
strstr(bin, "/ztest/")[0] = '\0'; /* In-tree */
strcat(bin, "/zdb/zdb");
if (strstr(bin, ".libs/ztest")) {
strstr(bin, ".libs/ztest")[0] = '\0'; /* In-tree */
strcat(bin, "zdb");
if (ztest_check_path(bin))
return;
}