summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShu-Chun Weng <scw@google.com>2021-05-03 16:47:10 -0700
committerFangrui Song <i@maskray.me>2021-08-27 17:26:06 -0700
commit8238afcd89abe20989becb1a3836291a0f8b67dd (patch)
treee3b97f9d562107970ef8cbb01876fd0aa1d0f016
parentdf64d523104d05a17c9ef66345077154588a5424 (diff)
downloadglibc-8238afcd89abe20989becb1a3836291a0f8b67dd.tar.gz
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.
-rw-r--r--io/tst-copy_file_range.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/io/tst-copy_file_range.c b/io/tst-copy_file_range.c
index 3d531a1937..38763328d3 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;