udev_monitor.c: check poll error early
This commit is contained in:
parent
37e5fa7206
commit
fb44266bfd
1 changed files with 5 additions and 5 deletions
|
|
@ -137,14 +137,14 @@ static void *handle_event(void *ptr)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
// exit on poll error
|
||||
if (!(poll_fds[0].revents & POLLIN)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
len = read(udev_monitor->ifd, data, sizeof(data));
|
||||
|
||||
if (len == -1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// exit on ifd error or close
|
||||
if (!(poll_fds[0].revents & POLLIN)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue