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

Comparing libev/ev.c (file contents):
Revision 1.321 by root, Thu Dec 31 06:50:17 2009 UTC vs.
Revision 1.322 by root, Thu Jan 7 06:49:31 2010 UTC

505 505
506#ifndef EV_FD_TO_WIN32_HANDLE 506#ifndef EV_FD_TO_WIN32_HANDLE
507# define EV_FD_TO_WIN32_HANDLE(fd) _get_osfhandle (fd) 507# define EV_FD_TO_WIN32_HANDLE(fd) _get_osfhandle (fd)
508#endif 508#endif
509#ifndef EV_WIN32_HANDLE_TO_FD 509#ifndef EV_WIN32_HANDLE_TO_FD
510# define EV_WIN32_HANDLE_TO_FD(handle) _open_osfhandle (fd, 0) 510# define EV_WIN32_HANDLE_TO_FD(handle) _open_osfhandle (handle, 0)
511#endif 511#endif
512#ifndef EV_WIN32_CLOSE_FD 512#ifndef EV_WIN32_CLOSE_FD
513# define EV_WIN32_CLOSE_FD(fd) close (fd) 513# define EV_WIN32_CLOSE_FD(fd) close (fd)
514#endif 514#endif
515 515
964/* check whether the given fd is atcually valid, for error recovery */ 964/* check whether the given fd is atcually valid, for error recovery */
965inline_size int 965inline_size int
966fd_valid (int fd) 966fd_valid (int fd)
967{ 967{
968#ifdef _WIN32 968#ifdef _WIN32
969 return _get_osfhandle (fd) != -1; 969 return EV_FD_TO_WIN32_HANDLE (fd) != -1;
970#else 970#else
971 return fcntl (fd, F_GETFD) != -1; 971 return fcntl (fd, F_GETFD) != -1;
972#endif 972#endif
973} 973}
974 974
1179inline_speed void 1179inline_speed void
1180fd_intern (int fd) 1180fd_intern (int fd)
1181{ 1181{
1182#ifdef _WIN32 1182#ifdef _WIN32
1183 unsigned long arg = 1; 1183 unsigned long arg = 1;
1184 ioctlsocket (_get_osfhandle (fd), FIONBIO, &arg); 1184 ioctlsocket (EV_FD_TO_WIN32_HANDLE (fd), FIONBIO, &arg);
1185#else 1185#else
1186 fcntl (fd, F_SETFD, FD_CLOEXEC); 1186 fcntl (fd, F_SETFD, FD_CLOEXEC);
1187 fcntl (fd, F_SETFL, O_NONBLOCK); 1187 fcntl (fd, F_SETFL, O_NONBLOCK);
1188#endif 1188#endif
1189} 1189}
1294{ 1294{
1295#if EV_MULTIPLICITY 1295#if EV_MULTIPLICITY
1296 EV_P = signals [signum - 1].loop; 1296 EV_P = signals [signum - 1].loop;
1297#endif 1297#endif
1298 1298
1299#if _WIN32 1299#ifdef _WIN32
1300 signal (signum, ev_sighandler); 1300 signal (signum, ev_sighandler);
1301#endif 1301#endif
1302 1302
1303 signals [signum - 1].pending = 1; 1303 signals [signum - 1].pending = 1;
1304 evpipe_write (EV_A_ &sig_pending); 1304 evpipe_write (EV_A_ &sig_pending);
2747 if (!((WL)w)->next) 2747 if (!((WL)w)->next)
2748# if EV_USE_SIGNALFD 2748# if EV_USE_SIGNALFD
2749 if (sigfd < 0) /*TODO*/ 2749 if (sigfd < 0) /*TODO*/
2750# endif 2750# endif
2751 { 2751 {
2752# if _WIN32 2752# ifdef _WIN32
2753 evpipe_init (EV_A); 2753 evpipe_init (EV_A);
2754 2754
2755 signal (w->signum, ev_sighandler); 2755 signal (w->signum, ev_sighandler);
2756# else 2756# else
2757 struct sigaction sa; 2757 struct sigaction sa;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines