From 8238afcd89abe20989becb1a3836291a0f8b67dd Mon Sep 17 00:00:00 2001 From: Shu-Chun Weng Date: Mon, 3 May 2021 16:47:10 -0700 Subject: [PATCH] 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. --- io/tst-copy_file_range.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/io/tst-copy_file_range.c b/io/tst-copy_file_range.c index 3d531a19370..38763328d38 100644 --- a/io/tst-copy_file_range.c +++ b/io/tst-copy_file_range.c @@ -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; -- 2.47.2