diff options
author | Dimitri John Ledkov <xnox@ubuntu.com> | 2017-05-12 12:32:07 +0100 |
---|---|---|
committer | Dimitri John Ledkov <xnox@ubuntu.com> | 2017-05-12 12:32:07 +0100 |
commit | 77b19ed5f259bc62680acf2b1a3454baa2472bc5 (patch) | |
tree | 7441d8d057c09e54c8ea23c984f2ccdf22c98649 /mdstat.c | |
parent | ca114f3c76374493f0fd64f8ea0a9b96ae9b1dc5 (diff) |
New upstream release.
Diffstat (limited to 'mdstat.c')
-rw-r--r-- | mdstat.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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"); |