ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev.c
(Generate patch)

Comparing libev/ev.c (file contents):
Revision 1.316 by root, Fri Sep 18 21:02:12 2009 UTC vs.
Revision 1.317 by root, Sat Nov 14 00:15:21 2009 UTC

1658 } 1658 }
1659 } 1659 }
1660 1660
1661#if EV_USE_SIGNALFD 1661#if EV_USE_SIGNALFD
1662 if (ev_is_active (&sigfd_w)) 1662 if (ev_is_active (&sigfd_w))
1663 {
1664 /*ev_ref (EV_A);*/
1665 /*ev_io_stop (EV_A_ &sigfd_w);*/
1666
1667 close (sigfd); 1663 close (sigfd);
1668 }
1669#endif 1664#endif
1670 1665
1671#if EV_USE_INOTIFY 1666#if EV_USE_INOTIFY
1672 if (fs_fd >= 0) 1667 if (fs_fd >= 0)
1673 close (fs_fd); 1668 close (fs_fd);
2752# if EV_USE_SIGNALFD 2747# if EV_USE_SIGNALFD
2753 if (sigfd < 0) /*TODO*/ 2748 if (sigfd < 0) /*TODO*/
2754# endif 2749# endif
2755 { 2750 {
2756# if _WIN32 2751# if _WIN32
2752 evpipe_init (EV_A);
2753
2757 signal (w->signum, ev_sighandler); 2754 signal (w->signum, ev_sighandler);
2758# else 2755# else
2759 struct sigaction sa; 2756 struct sigaction sa;
2760 2757
2761 evpipe_init (EV_A); 2758 evpipe_init (EV_A);
2896 struct statfs sfs; 2893 struct statfs sfs;
2897 2894
2898 wlist_add (&fs_hash [w->wd & (EV_INOTIFY_HASHSIZE - 1)].head, (WL)w); 2895 wlist_add (&fs_hash [w->wd & (EV_INOTIFY_HASHSIZE - 1)].head, (WL)w);
2899 2896
2900 /* now local changes will be tracked by inotify, but remote changes won't */ 2897 /* now local changes will be tracked by inotify, but remote changes won't */
2901 /* unless the filesystem it known to be local, we therefore still poll */ 2898 /* unless the filesystem is known to be local, we therefore still poll */
2902 /* also do poll on <2.6.25, but with normal frequency */ 2899 /* also do poll on <2.6.25, but with normal frequency */
2903 2900
2904 if (fs_2625 && !statfs (w->path, &sfs)) 2901 if (fs_2625 && !statfs (w->path, &sfs))
2905 if (sfs.f_type == 0x1373 /* devfs */ 2902 if (sfs.f_type == 0x1373 /* devfs */
2906 || sfs.f_type == 0xEF53 /* ext2/3 */ 2903 || sfs.f_type == 0xEF53 /* ext2/3 */
3025 { 3022 {
3026 fd_intern (fs_fd); 3023 fd_intern (fs_fd);
3027 ev_io_init (&fs_w, infy_cb, fs_fd, EV_READ); 3024 ev_io_init (&fs_w, infy_cb, fs_fd, EV_READ);
3028 ev_set_priority (&fs_w, EV_MAXPRI); 3025 ev_set_priority (&fs_w, EV_MAXPRI);
3029 ev_io_start (EV_A_ &fs_w); 3026 ev_io_start (EV_A_ &fs_w);
3027 ev_unref (EV_A);
3030 } 3028 }
3031} 3029}
3032 3030
3033inline_size void 3031inline_size void
3034infy_fork (EV_P) 3032infy_fork (EV_P)
3036 int slot; 3034 int slot;
3037 3035
3038 if (fs_fd < 0) 3036 if (fs_fd < 0)
3039 return; 3037 return;
3040 3038
3039 ev_ref (EV_A);
3041 ev_io_stop (EV_A_ &fs_w); 3040 ev_io_stop (EV_A_ &fs_w);
3042 close (fs_fd); 3041 close (fs_fd);
3043 fs_fd = infy_newfd (); 3042 fs_fd = infy_newfd ();
3044 3043
3045 if (fs_fd >= 0) 3044 if (fs_fd >= 0)
3046 { 3045 {
3047 fd_intern (fs_fd); 3046 fd_intern (fs_fd);
3048 ev_io_set (&fs_w, fs_fd, EV_READ); 3047 ev_io_set (&fs_w, fs_fd, EV_READ);
3049 ev_io_start (EV_A_ &fs_w); 3048 ev_io_start (EV_A_ &fs_w);
3049 ev_unref (EV_A);
3050 } 3050 }
3051 3051
3052 for (slot = 0; slot < EV_INOTIFY_HASHSIZE; ++slot) 3052 for (slot = 0; slot < EV_INOTIFY_HASHSIZE; ++slot)
3053 { 3053 {
3054 WL w_ = fs_hash [slot].head; 3054 WL w_ = fs_hash [slot].head;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines