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

Comparing libev/ev.c (file contents):
Revision 1.36 by root, Thu Nov 1 13:11:11 2007 UTC vs.
Revision 1.38 by root, Thu Nov 1 15:21:13 2007 UTC

47#include <sys/wait.h> 47#include <sys/wait.h>
48#include <sys/time.h> 48#include <sys/time.h>
49#include <time.h> 49#include <time.h>
50 50
51#ifndef EV_USE_MONOTONIC 51#ifndef EV_USE_MONOTONIC
52# ifdef CLOCK_MONOTONIC
53# define EV_USE_MONOTONIC 1 52# define EV_USE_MONOTONIC 1
54# endif 53#endif
54
55#ifndef CLOCK_MONOTONIC
56# undef EV_USE_MONOTONIC
57# define EV_USE_MONOTONIC 0
55#endif 58#endif
56 59
57#ifndef EV_USE_SELECT 60#ifndef EV_USE_SELECT
58# define EV_USE_SELECT 1 61# define EV_USE_SELECT 1
59#endif 62#endif
363 366
364static void 367static void
365sigcb (struct ev_io *iow, int revents) 368sigcb (struct ev_io *iow, int revents)
366{ 369{
367 struct ev_signal *w; 370 struct ev_signal *w;
368 int sig; 371 int signum;
369 372
370 read (sigpipe [0], &revents, 1); 373 read (sigpipe [0], &revents, 1);
371 gotsig = 0; 374 gotsig = 0;
372 375
373 for (sig = signalmax; sig--; ) 376 for (signum = signalmax; signum--; )
374 if (signals [sig].gotsig) 377 if (signals [signum].gotsig)
375 { 378 {
376 signals [sig].gotsig = 0; 379 signals [signum].gotsig = 0;
377 380
378 for (w = signals [sig].head; w; w = w->next) 381 for (w = signals [signum].head; w; w = w->next)
379 event ((W)w, EV_SIGNAL); 382 event ((W)w, EV_SIGNAL);
380 } 383 }
381} 384}
382 385
383static void 386static void
763/*****************************************************************************/ 766/*****************************************************************************/
764 767
765void 768void
766ev_io_start (struct ev_io *w) 769ev_io_start (struct ev_io *w)
767{ 770{
768 if (ev_is_active (w))
769 return;
770
771 int fd = w->fd; 771 int fd = w->fd;
772
773 if (ev_is_active (w))
774 return;
772 775
773 assert (("ev_io_start called with negative fd", fd >= 0)); 776 assert (("ev_io_start called with negative fd", fd >= 0));
774 777
775 ev_start ((W)w, 1); 778 ev_start ((W)w, 1);
776 array_needsize (anfds, anfdmax, fd + 1, anfds_init); 779 array_needsize (anfds, anfdmax, fd + 1, anfds_init);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines