From 201d885cf454e026cf59e18961f025bcfa8a3142 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 25 Jul 2024 08:14:23 +0200 Subject: Merging upstream version 4.3+20240723. Signed-off-by: Daniel Baumann --- mdstat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mdstat.c') diff --git a/mdstat.c b/mdstat.c index 2fd792c..e233f09 100644 --- a/mdstat.c +++ b/mdstat.c @@ -348,7 +348,8 @@ void mdstat_wait_fd(int fd, const sigset_t *sigmask) if (fd >= 0) { struct stat stb; - fstat(fd, &stb); + if (fstat(fd, &stb) != 0) + return; if ((stb.st_mode & S_IFMT) == S_IFREG) /* Must be a /proc or /sys fd, so expect * POLLPRI -- cgit v1.2.3