1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-09 00:00:03 +01:00

add check if inotify_add_watch returns descriptor

This commit is contained in:
Stefan Lankes 2017-02-18 13:20:43 +01:00
parent 1066d01be4
commit d1058f28e9

View file

@ -250,6 +250,11 @@ static void wait_hermit_available(void)
else
wd = inotify_add_watch(fd, "/sys/hermit", IN_MODIFY|IN_CREATE);
if (wd < 0) {
perror("inotify_add_watch");
exit(1);
}
while(1) {
int length = read(fd, buffer, BUF_LEN);