… | |
… | |
287 | # endif |
287 | # endif |
288 | #endif |
288 | #endif |
289 | |
289 | |
290 | #if EV_USE_INOTIFY |
290 | #if EV_USE_INOTIFY |
291 | # include <sys/utsname.h> |
291 | # include <sys/utsname.h> |
292 | # include <sys/statfs.h> |
|
|
293 | # include <sys/inotify.h> |
292 | # include <sys/inotify.h> |
294 | /* some very old inotify.h headers don't have IN_DONT_FOLLOW */ |
293 | /* some very old inotify.h headers don't have IN_DONT_FOLLOW */ |
295 | # ifndef IN_DONT_FOLLOW |
294 | # ifndef IN_DONT_FOLLOW |
296 | # undef EV_USE_INOTIFY |
295 | # undef EV_USE_INOTIFY |
297 | # define EV_USE_INOTIFY 0 |
296 | # define EV_USE_INOTIFY 0 |
… | |
… | |
2457 | } |
2456 | } |
2458 | while (w->wd < 0 && (errno == ENOENT || errno == EACCES)); |
2457 | while (w->wd < 0 && (errno == ENOENT || errno == EACCES)); |
2459 | } |
2458 | } |
2460 | } |
2459 | } |
2461 | else |
2460 | else |
2462 | todo, on nfs etc., we need to poll every 60s or so |
|
|
2463 | ev_timer_stop (EV_A_ &w->timer); /* we can watch this in a race-free way */ |
2461 | ev_timer_stop (EV_A_ &w->timer); /* we can watch this in a race-free way */ |
2464 | |
2462 | |
2465 | if (w->wd >= 0) |
2463 | if (w->wd >= 0) |
2466 | wlist_add (&fs_hash [w->wd & (EV_INOTIFY_HASHSIZE - 1)].head, (WL)w); |
2464 | wlist_add (&fs_hash [w->wd & (EV_INOTIFY_HASHSIZE - 1)].head, (WL)w); |
2467 | } |
2465 | } |