Don't crash if /var/tmp doesn't exist

`xstat` is checked `stat64` crashing the program if the latter returns
failure. In this loop, we are trying to find one folder that satisfies
the condition, no reason to crash the program if one folder doesn't.
This commit is contained in:
Shu-Chun Weng 2021-05-03 16:47:10 -07:00 committed by Fangrui Song
parent df64d52310
commit 8238afcd89

View File

@ -759,8 +759,7 @@ do_test (void)
}
struct stat64 cstat;
xstat (path, &cstat);
if (cstat.st_dev == instat.st_dev)
if (stat (path, &cstat) != 0 || cstat.st_dev == instat.st_dev)
{
free (to_free);
continue;