… | |
… | |
985 | array_free (check, EMPTY0); |
985 | array_free (check, EMPTY0); |
986 | |
986 | |
987 | backend = 0; |
987 | backend = 0; |
988 | } |
988 | } |
989 | |
989 | |
|
|
990 | void inline_size infy_fork (EV_P); |
|
|
991 | |
990 | void inline_size |
992 | void inline_size |
991 | loop_fork (EV_P) |
993 | loop_fork (EV_P) |
992 | { |
994 | { |
993 | #if EV_USE_PORT |
995 | #if EV_USE_PORT |
994 | if (backend == EVBACKEND_PORT ) port_fork (EV_A); |
996 | if (backend == EVBACKEND_PORT ) port_fork (EV_A); |
… | |
… | |
996 | #if EV_USE_KQUEUE |
998 | #if EV_USE_KQUEUE |
997 | if (backend == EVBACKEND_KQUEUE) kqueue_fork (EV_A); |
999 | if (backend == EVBACKEND_KQUEUE) kqueue_fork (EV_A); |
998 | #endif |
1000 | #endif |
999 | #if EV_USE_EPOLL |
1001 | #if EV_USE_EPOLL |
1000 | if (backend == EVBACKEND_EPOLL ) epoll_fork (EV_A); |
1002 | if (backend == EVBACKEND_EPOLL ) epoll_fork (EV_A); |
|
|
1003 | #endif |
|
|
1004 | #if EV_USE_INOTIFY |
|
|
1005 | infy_fork (EV_A); |
1001 | #endif |
1006 | #endif |
1002 | |
1007 | |
1003 | if (ev_is_active (&sigev)) |
1008 | if (ev_is_active (&sigev)) |
1004 | { |
1009 | { |
1005 | /* default loop */ |
1010 | /* default loop */ |
… | |
… | |
1831 | ev_set_priority (&fs_w, EV_MAXPRI); |
1836 | ev_set_priority (&fs_w, EV_MAXPRI); |
1832 | ev_io_start (EV_A_ &fs_w); |
1837 | ev_io_start (EV_A_ &fs_w); |
1833 | } |
1838 | } |
1834 | } |
1839 | } |
1835 | |
1840 | |
|
|
1841 | void inline_size |
|
|
1842 | infy_fork (EV_P) |
|
|
1843 | { |
|
|
1844 | int slot; |
|
|
1845 | |
|
|
1846 | if (fs_fd < 0) |
|
|
1847 | return; |
|
|
1848 | |
|
|
1849 | close (fs_fd); |
|
|
1850 | fs_fd = inotify_init (); |
|
|
1851 | |
|
|
1852 | for (slot = 0; slot < EV_INOTIFY_HASHSIZE; ++slot) |
|
|
1853 | { |
|
|
1854 | WL w_ = fs_hash [slot].head; |
|
|
1855 | fs_hash [slot].head = 0; |
|
|
1856 | |
|
|
1857 | while (w_) |
|
|
1858 | { |
|
|
1859 | ev_stat *w = (ev_stat *)w_; |
|
|
1860 | w_ = w_->next; /* lets us add this watcher */ |
|
|
1861 | |
|
|
1862 | w->wd = -1; |
|
|
1863 | |
|
|
1864 | if (fs_fd >= 0) |
|
|
1865 | infy_add (EV_A_ w); /* re-add, no matter what */ |
|
|
1866 | else |
|
|
1867 | ev_timer_start (EV_A_ &w->timer); |
|
|
1868 | } |
|
|
1869 | |
|
|
1870 | } |
|
|
1871 | } |
|
|
1872 | |
1836 | #endif |
1873 | #endif |
1837 | |
1874 | |
1838 | void |
1875 | void |
1839 | ev_stat_stat (EV_P_ ev_stat *w) |
1876 | ev_stat_stat (EV_P_ ev_stat *w) |
1840 | { |
1877 | { |