From 77b19ed5f259bc62680acf2b1a3454baa2472bc5 Mon Sep 17 00:00:00 2001 From: Dimitri John Ledkov Date: Fri, 12 May 2017 12:32:07 +0100 Subject: New upstream release. --- mdstat.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'mdstat.c') diff --git a/mdstat.c b/mdstat.c index 2972cdf6..39628967 100644 --- a/mdstat.c +++ b/mdstat.c @@ -133,7 +133,11 @@ struct mdstat_ent *mdstat_read(int hold, int start) int fd; if (hold && mdstat_fd != -1) { - lseek(mdstat_fd, 0L, 0); + off_t offset = lseek(mdstat_fd, 0L, 0); + if (offset == (off_t)-1) { + mdstat_close(); + return NULL; + } fd = dup(mdstat_fd); if (fd >= 0) f = fdopen(fd, "r"); -- cgit v1.2.3