X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=mdstat.c;h=8de51cf755fa0e718f321d54c3714abd92f04cd9;hb=4a06e2c270948bdcfaa447c8a0e80abb0978b5c4;hp=ebdfc67bf6d46705e1ebcb74212299b2aa47b66c;hpb=6c766cf10178b9bae4ddcfd6b8de2d70f9d84568;p=thirdparty%2Fmdadm.git diff --git a/mdstat.c b/mdstat.c index ebdfc67b..8de51cf7 100644 --- a/mdstat.c +++ b/mdstat.c @@ -280,8 +280,18 @@ void mdstat_wait_fd(int fd, const sigset_t *sigmask) FD_ZERO(&rfds); if (mdstat_fd >= 0) FD_SET(mdstat_fd, &fds); - if (fd >= 0) - FD_SET(fd, &rfds); + if (fd >= 0) { + struct stat stb; + fstat(fd, &stb); + if ((stb.st_mode & S_IFMT) == S_IFREG) + /* Must be a /proc or /sys fd, so expect + * POLLPRI + * i.e. an 'exceptional' event. + */ + FD_SET(fd, &fds); + else + FD_SET(fd, &rfds); + } if (mdstat_fd > maxfd) maxfd = mdstat_fd;