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

Comparing libev/ev.c (file contents):
Revision 1.265 by root, Thu Oct 23 04:56:49 2008 UTC vs.
Revision 1.272 by root, Mon Nov 3 12:17:40 2008 UTC

388{ 388{
389 syserr_cb = cb; 389 syserr_cb = cb;
390} 390}
391 391
392static void noinline 392static void noinline
393syserr (const char *msg) 393ev_syserr (const char *msg)
394{ 394{
395 if (!msg) 395 if (!msg)
396 msg = "(libev) system error"; 396 msg = "(libev) system error";
397 397
398 if (syserr_cb) 398 if (syserr_cb)
450{ 450{
451 WL head; 451 WL head;
452 unsigned char events; 452 unsigned char events;
453 unsigned char reify; 453 unsigned char reify;
454 unsigned char emask; /* the epoll backend stores the actual kernel mask in here */ 454 unsigned char emask; /* the epoll backend stores the actual kernel mask in here */
455 unsigned char unused; /* currently unused padding */ 455 unsigned char unused;
456#if EV_USE_EPOLL
457 unsigned int egen; /* generation counter to counter epoll bugs */
458#endif
456#if EV_SELECT_IS_WINSOCKET 459#if EV_SELECT_IS_WINSOCKET
457 SOCKET handle; 460 SOCKET handle;
458#endif 461#endif
459} ANFD; 462} ANFD;
460 463
806 809
807 for (fd = 0; fd < anfdmax; ++fd) 810 for (fd = 0; fd < anfdmax; ++fd)
808 if (anfds [fd].events) 811 if (anfds [fd].events)
809 { 812 {
810 anfds [fd].events = 0; 813 anfds [fd].events = 0;
814 anfds [fd].emask = 0;
811 fd_change (EV_A_ fd, EV_IOFDSET | 1); 815 fd_change (EV_A_ fd, EV_IOFDSET | 1);
812 } 816 }
813} 817}
814 818
815/*****************************************************************************/ 819/*****************************************************************************/
997 } 1001 }
998 else 1002 else
999#endif 1003#endif
1000 { 1004 {
1001 while (pipe (evpipe)) 1005 while (pipe (evpipe))
1002 syserr ("(libev) error creating signal/async pipe"); 1006 ev_syserr ("(libev) error creating signal/async pipe");
1003 1007
1004 fd_intern (evpipe [0]); 1008 fd_intern (evpipe [0]);
1005 fd_intern (evpipe [1]); 1009 fd_intern (evpipe [1]);
1006 ev_io_set (&pipeev, evpipe [0], EV_READ); 1010 ev_io_set (&pipeev, evpipe [0], EV_READ);
1007 } 1011 }
1638{ 1642{
1639#if EV_MULTIPLICITY 1643#if EV_MULTIPLICITY
1640 struct ev_loop *loop = ev_default_loop_ptr; 1644 struct ev_loop *loop = ev_default_loop_ptr;
1641#endif 1645#endif
1642 1646
1647 ev_default_loop_ptr = 0;
1648
1643#ifndef _WIN32 1649#ifndef _WIN32
1644 ev_ref (EV_A); /* child watcher */ 1650 ev_ref (EV_A); /* child watcher */
1645 ev_signal_stop (EV_A_ &childev); 1651 ev_signal_stop (EV_A_ &childev);
1646#endif 1652#endif
1647 1653
1653{ 1659{
1654#if EV_MULTIPLICITY 1660#if EV_MULTIPLICITY
1655 struct ev_loop *loop = ev_default_loop_ptr; 1661 struct ev_loop *loop = ev_default_loop_ptr;
1656#endif 1662#endif
1657 1663
1658 if (backend)
1659 postfork = 1; /* must be in line with ev_loop_fork */ 1664 postfork = 1; /* must be in line with ev_loop_fork */
1660} 1665}
1661 1666
1662/*****************************************************************************/ 1667/*****************************************************************************/
1663 1668
1664void 1669void
2427 if (w->wd < 0) 2432 if (w->wd < 0)
2428 { 2433 {
2429 ev_timer_start (EV_A_ &w->timer); /* this is not race-free, so we still need to recheck periodically */ 2434 ev_timer_start (EV_A_ &w->timer); /* this is not race-free, so we still need to recheck periodically */
2430 2435
2431 /* monitor some parent directory for speedup hints */ 2436 /* monitor some parent directory for speedup hints */
2432 /* note that exceeding the hardcoded limit is not a correctness issue, */ 2437 /* note that exceeding the hardcoded path limit is not a correctness issue, */
2433 /* but an efficiency issue only */ 2438 /* but an efficiency issue only */
2434 if ((errno == ENOENT || errno == EACCES) && strlen (w->path) < 4096) 2439 if ((errno == ENOENT || errno == EACCES) && strlen (w->path) < 4096)
2435 { 2440 {
2436 char path [4096]; 2441 char path [4096];
2437 strcpy (path, w->path); 2442 strcpy (path, w->path);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines