diff --git a/deps/libev/Changes b/deps/libev/Changes index 53bb646195..d6fca2f67c 100644 --- a/deps/libev/Changes +++ b/deps/libev/Changes @@ -1,5 +1,14 @@ Revision history for libev, a high-performance and full-featured event loop. +4.04 Wed Feb 16 09:01:51 CET 2011 + - fix two problems in the native win32 backend, where reuse of fd's + with different underlying handles caused handles not to be removed + or added to the select set (analyzed and tested by Bert Belder). + - do no rely on ceil() in ev_e?poll.c. + - backport libev to HP-UX versions before 11 v3. + - configure did not detect nanosleep and clock_gettime properly when + they are available in the libc (as opposed to -lrt). + 4.03 Tue Jan 11 14:37:25 CET 2011 - officially support polling files with all backends. - support files, /dev/zero etc. the same way as select in the epoll diff --git a/deps/libev/configure.ac b/deps/libev/configure.ac index 5a8ea283ee..03a784f2eb 100644 --- a/deps/libev/configure.ac +++ b/deps/libev/configure.ac @@ -1,7 +1,7 @@ AC_INIT AC_CONFIG_SRCDIR([ev_epoll.c]) -AM_INIT_AUTOMAKE(libev,4.03) dnl also update ev.h! +AM_INIT_AUTOMAKE(libev,4.04) dnl also update ev.h! AC_CONFIG_HEADERS([config.h]) AM_MAINTAINER_MODE diff --git a/deps/libev/ev++.h b/deps/libev/ev++.h index d85be55c52..ce42b5f2de 100644 --- a/deps/libev/ev++.h +++ b/deps/libev/ev++.h @@ -6,14 +6,14 @@ * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO diff --git a/deps/libev/ev.3 b/deps/libev/ev.3 index a5c974ce16..f2a4514582 100644 --- a/deps/libev/ev.3 +++ b/deps/libev/ev.3 @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "LIBEV 3" -.TH LIBEV 3 "2011-01-11" "libev-4.03" "libev - high performance full featured event loop" +.TH LIBEV 3 "2011-02-16" "libev-4.04" "libev - high performance full featured event loop" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -191,7 +191,7 @@ libev \- a high performance full\-featured event loop written in C \& // now wait for events to arrive \& ev_run (loop, 0); \& -\& // unloop was called, so exit +\& // break was called, so exit \& return 0; \& } .Ve @@ -562,6 +562,9 @@ This behaviour is useful when you want to do your own signal handling, or want to handle signals only in specific threads and want to avoid libev unblocking the signals. .Sp +It's also required by \s-1POSIX\s0 in a threaded program, as libev calls +\&\f(CW\*(C`sigprocmask\*(C'\fR, whose behaviour is officially unspecified. +.Sp This flag's behaviour will become the default in future versions of libev. .ie n .IP """EVBACKEND_SELECT"" (value 1, portable select backend)" 4 .el .IP "\f(CWEVBACKEND_SELECT\fR (value 1, portable select backend)" 4 @@ -987,7 +990,7 @@ anymore. \& ... queue jobs here, make sure they register event watchers as long \& ... as they still have work to do (even an idle watcher will do..) \& ev_run (my_loop, 0); -\& ... jobs done or somebody called unloop. yeah! +\& ... jobs done or somebody called break. yeah! .Ve .IP "ev_break (loop, how)" 4 .IX Item "ev_break (loop, how)" @@ -1492,8 +1495,10 @@ Before a watcher can be registered with the event looop it has to be initialised. This can be done with a call to \f(CW\*(C`ev_TYPE_init\*(C'\fR, or calls to \&\f(CW\*(C`ev_init\*(C'\fR followed by the watcher-specific \f(CW\*(C`ev_TYPE_set\*(C'\fR function. .Sp -In this state it is simply some block of memory that is suitable for use -in an event loop. It can be moved around, freed, reused etc. at will. +In this state it is simply some block of memory that is suitable for +use in an event loop. It can be moved around, freed, reused etc. at +will \- as long as you either keep the memory contents intact, or call +\&\f(CW\*(C`ev_TYPE_init\*(C'\fR again. .IP "started/running/active" 4 .IX Item "started/running/active" Once a watcher has been started with a call to \f(CW\*(C`ev_TYPE_start\*(C'\fR it becomes @@ -1528,8 +1533,9 @@ of whether it was active or not, so stopping a watcher explicitly before freeing it is often a good idea. .Sp While stopped (and not pending) the watcher is essentially in the -initialised state, that is it can be reused, moved, modified in any way -you wish. +initialised state, that is, it can be reused, moved, modified in any way +you wish (but when you trash the memory block, you need to \f(CW\*(C`ev_TYPE_init\*(C'\fR +it again). .SS "\s-1WATCHER\s0 \s-1PRIORITY\s0 \s-1MODELS\s0" .IX Subsection "WATCHER PRIORITY MODELS" Many event loops support \fIwatcher priorities\fR, which are usually small @@ -2431,7 +2437,8 @@ and unblock them in an \f(CW\*(C`ev_prepare\*(C'\fR watcher. Both the signal mask (\f(CW\*(C`sigprocmask\*(C'\fR) and the signal disposition (\f(CW\*(C`sigaction\*(C'\fR) are unspecified after starting a signal watcher (and after stopping it again), that is, libev might or might not block the signal, -and might or might not set or restore the installed signal handler. +and might or might not set or restore the installed signal handler (but +see \f(CW\*(C`EVFLAG_NOSIGMASK\*(C'\fR). .PP While this does not matter for the signal disposition (libev never sets signals to \f(CW\*(C`SIG_IGN\*(C'\fR, so handlers will be reset to \f(CW\*(C`SIG_DFL\*(C'\fR on @@ -3309,7 +3316,7 @@ cleanup functions are called. .ie n .SS """ev_async"" \- how to wake up an event loop" .el .SS "\f(CWev_async\fP \- how to wake up an event loop" .IX Subsection "ev_async - how to wake up an event loop" -In general, you cannot use an \f(CW\*(C`ev_run\*(C'\fR from multiple threads or other +In general, you cannot use an \f(CW\*(C`ev_loop\*(C'\fR from multiple threads or other asynchronous sources such as signal handlers (as opposed to multiple event loops \- those are of course safe to use in different threads). .PP @@ -3424,10 +3431,12 @@ trust me. .IP "ev_async_send (loop, ev_async *)" 4 .IX Item "ev_async_send (loop, ev_async *)" Sends/signals/activates the given \f(CW\*(C`ev_async\*(C'\fR watcher, that is, feeds -an \f(CW\*(C`EV_ASYNC\*(C'\fR event on the watcher into the event loop. Unlike -\&\f(CW\*(C`ev_feed_event\*(C'\fR, this call is safe to do from other threads, signal or -similar contexts (see the discussion of \f(CW\*(C`EV_ATOMIC_T\*(C'\fR in the embedding -section below on what exactly this means). +an \f(CW\*(C`EV_ASYNC\*(C'\fR event on the watcher into the event loop, and instantly +returns. +.Sp +Unlike \f(CW\*(C`ev_feed_event\*(C'\fR, this call is safe to do from other threads, +signal or similar contexts (see the discussion of \f(CW\*(C`EV_ATOMIC_T\*(C'\fR in the +embedding section below on what exactly this means). .Sp Note that, as with other watchers in libev, multiple events might get compressed into a single callback invocation (another way to look at this @@ -3660,7 +3669,7 @@ First, you need to associate some data with the event loop: \& ev_set_invoke_pending_cb (EV_A_ l_invoke); \& ev_set_loop_release_cb (EV_A_ l_release, l_acquire); \& -\& // then create the thread running ev_loop +\& // then create the thread running ev_run \& pthread_create (&u\->tid, 0, l_run, EV_A); \& } .Ve @@ -5290,7 +5299,7 @@ The physical time that is observed. It is apparently strictly monotonic :) .IP "wall-clock time" 4 .IX Item "wall-clock time" The time and date as shown on clocks. Unlike real time, it can actually -be wrong and jump forwards and backwards, e.g. when the you adjust your +be wrong and jump forwards and backwards, e.g. when you adjust your clock. .IP "watcher" 4 .IX Item "watcher" @@ -5299,4 +5308,4 @@ to be started (attached to an event loop) before they can receive events. .SH "AUTHOR" .IX Header "AUTHOR" Marc Lehmann , with repeated corrections by Mikael -Magnusson and Emanuele Giaquinta. +Magnusson and Emanuele Giaquinta, and minor corrections by many others. diff --git a/deps/libev/ev.c b/deps/libev/ev.c index 3d956b53de..4187b18af7 100644 --- a/deps/libev/ev.c +++ b/deps/libev/ev.c @@ -6,14 +6,14 @@ * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO @@ -378,7 +378,8 @@ EV_CPP(extern "C" {) #endif #if !EV_USE_NANOSLEEP -# ifndef _WIN32 +/* hp-ux has it in sys/time.h, which we unconditionally include above */ +# if !defined(_WIN32) && !defined(__hpux) # include # endif #endif @@ -817,6 +818,14 @@ ev_sleep (ev_tstamp delay) } } +inline_speed int +ev_timeout_to_ms (ev_tstamp timeout) +{ + int ms = timeout * 1000. + .999999; + + return expect_true (ms) ? ms : timeout < 1e-6 ? 0 : 1; +} + /*****************************************************************************/ #define MALLOC_ROUND 4096 /* prefer to allocate in chunks of this size, must be 2**n and >> 4 longs */ @@ -1328,12 +1337,12 @@ evpipe_write (EV_P_ EV_ATOMIC_T *flag) } else #endif - -#ifdef __MINGW32__ - send(EV_FD_TO_WIN32_HANDLE(evpipe [1]), &dummy, 1, 0); -#else - write (evpipe [1], &dummy, 1); -#endif + /* win32 people keep sending patches that change this write() to send() */ + /* and then run away. but send() is wrong, it wants a socket handle on win32 */ + /* so when you think this write should be a send instead, please find out */ + /* where your send() is from - it's definitely not the microsoft send, and */ + /* tell me. thank you. */ + write (evpipe [1], &dummy, 1); errno = old_errno; } @@ -1356,21 +1365,20 @@ pipecb (EV_P_ ev_io *iow, int revents) #endif { char dummy; -#ifdef __MINGW32__ - recv(EV_FD_TO_WIN32_HANDLE(evpipe [0]), &dummy, 1, 0); -#else + /* see discussion in evpipe_write when you think this read should be recv in win32 */ read (evpipe [0], &dummy, 1); -#endif } +#if EV_SIGNAL_ENABLE if (sig_pending) - { + { sig_pending = 0; for (i = EV_NSIG - 1; i--; ) if (expect_false (signals [i].pending)) ev_feed_signal_event (EV_A_ i + 1); } +#endif #if EV_ASYNC_ENABLE if (async_pending) @@ -2201,6 +2209,15 @@ timers_reify (EV_P) } #if EV_PERIODIC_ENABLE + +inline_speed void +periodic_recalc (EV_P_ ev_periodic *w) +{ + /* TODO: use slow but potentially more correct incremental algo, */ + /* also do not rely on ceil */ + ev_at (w) = w->offset + ceil ((ev_rt_now - w->offset) / w->interval) * w->interval; +} + /* make periodics pending */ inline_size void periodics_reify (EV_P) @@ -2229,7 +2246,8 @@ periodics_reify (EV_P) } else if (w->interval) { - ev_at (w) = w->offset + ceil ((ev_rt_now - w->offset) / w->interval) * w->interval; + periodic_recalc (EV_A_ w); + /* if next trigger time is not sufficiently in the future, put it there */ /* this might happen because of floating point inexactness */ if (ev_at (w) - ev_rt_now < TIME_EPSILON) @@ -2273,7 +2291,7 @@ periodics_reschedule (EV_P) if (w->reschedule_cb) ev_at (w) = w->reschedule_cb (w, ev_rt_now); else if (w->interval) - ev_at (w) = w->offset + ceil ((ev_rt_now - w->offset) / w->interval) * w->interval; + periodic_recalc (EV_A_ w); ANHE_at_cache (periodics [i]); } @@ -2775,8 +2793,7 @@ ev_periodic_start (EV_P_ ev_periodic *w) else if (w->interval) { assert (("libev: ev_periodic_start called with negative interval value", w->interval >= 0.)); - /* this formula differs from the one in periodic_reify because we do not always round up */ - ev_at (w) = w->offset + ceil ((ev_rt_now - w->offset) / w->interval) * w->interval; + periodic_recalc (EV_A_ w); } else ev_at (w) = w->offset; @@ -3063,7 +3080,7 @@ infy_add (EV_P_ ev_stat *w) *pend = 0; w->wd = inotify_add_watch (fs_fd, path, mask); - } + } while (w->wd < 0 && (errno == ENOENT || errno == EACCES)); } } diff --git a/deps/libev/ev.h b/deps/libev/ev.h index 9edf6564e9..27c1778f1f 100644 --- a/deps/libev/ev.h +++ b/deps/libev/ev.h @@ -6,14 +6,14 @@ * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO @@ -185,7 +185,7 @@ struct ev_loop; # define EV_INLINE static #endif -/* EV_PROTOTYPES can be sued to switch of prototype declarations */ +/* EV_PROTOTYPES can be used to switch of prototype declarations */ #ifndef EV_PROTOTYPES # define EV_PROTOTYPES 1 #endif @@ -193,7 +193,7 @@ struct ev_loop; /*****************************************************************************/ #define EV_VERSION_MAJOR 4 -#define EV_VERSION_MINOR 3 +#define EV_VERSION_MINOR 4 /* eventmask, revents, events... */ enum { diff --git a/deps/libev/ev.pod b/deps/libev/ev.pod index 6cd777e658..4bbef1fcf2 100644 --- a/deps/libev/ev.pod +++ b/deps/libev/ev.pod @@ -60,7 +60,7 @@ libev - a high performance full-featured event loop written in C // now wait for events to arrive ev_run (loop, 0); - // unloop was called, so exit + // break was called, so exit return 0; } @@ -444,6 +444,9 @@ This behaviour is useful when you want to do your own signal handling, or want to handle signals only in specific threads and want to avoid libev unblocking the signals. +It's also required by POSIX in a threaded program, as libev calls +C, whose behaviour is officially unspecified. + This flag's behaviour will become the default in future versions of libev. =item C (value 1, portable select backend) @@ -867,7 +870,7 @@ anymore. ... queue jobs here, make sure they register event watchers as long ... as they still have work to do (even an idle watcher will do..) ev_run (my_loop, 0); - ... jobs done or somebody called unloop. yeah! + ... jobs done or somebody called break. yeah! =item ev_break (loop, how) @@ -1377,8 +1380,10 @@ Before a watcher can be registered with the event looop it has to be initialised. This can be done with a call to C, or calls to C followed by the watcher-specific C function. -In this state it is simply some block of memory that is suitable for use -in an event loop. It can be moved around, freed, reused etc. at will. +In this state it is simply some block of memory that is suitable for +use in an event loop. It can be moved around, freed, reused etc. at +will - as long as you either keep the memory contents intact, or call +C again. =item started/running/active @@ -1416,8 +1421,9 @@ of whether it was active or not, so stopping a watcher explicitly before freeing it is often a good idea. While stopped (and not pending) the watcher is essentially in the -initialised state, that is it can be reused, moved, modified in any way -you wish. +initialised state, that is, it can be reused, moved, modified in any way +you wish (but when you trash the memory block, you need to C +it again). =back @@ -2302,7 +2308,8 @@ and unblock them in an C watcher. Both the signal mask (C) and the signal disposition (C) are unspecified after starting a signal watcher (and after stopping it again), that is, libev might or might not block the signal, -and might or might not set or restore the installed signal handler. +and might or might not set or restore the installed signal handler (but +see C). While this does not matter for the signal disposition (libev never sets signals to C, so handlers will be reset to C on @@ -3183,7 +3190,7 @@ cleanup functions are called. =head2 C - how to wake up an event loop -In general, you cannot use an C from multiple threads or other +In general, you cannot use an C from multiple threads or other asynchronous sources such as signal handlers (as opposed to multiple event loops - those are of course safe to use in different threads). @@ -3303,10 +3310,12 @@ trust me. =item ev_async_send (loop, ev_async *) Sends/signals/activates the given C watcher, that is, feeds -an C event on the watcher into the event loop. Unlike -C, this call is safe to do from other threads, signal or -similar contexts (see the discussion of C in the embedding -section below on what exactly this means). +an C event on the watcher into the event loop, and instantly +returns. + +Unlike C, this call is safe to do from other threads, +signal or similar contexts (see the discussion of C in the +embedding section below on what exactly this means). Note that, as with other watchers in libev, multiple events might get compressed into a single callback invocation (another way to look at this @@ -3542,7 +3551,7 @@ First, you need to associate some data with the event loop: ev_set_invoke_pending_cb (EV_A_ l_invoke); ev_set_loop_release_cb (EV_A_ l_release, l_acquire); - // then create the thread running ev_loop + // then create the thread running ev_run pthread_create (&u->tid, 0, l_run, EV_A); } @@ -5217,7 +5226,7 @@ The physical time that is observed. It is apparently strictly monotonic :) =item wall-clock time The time and date as shown on clocks. Unlike real time, it can actually -be wrong and jump forwards and backwards, e.g. when the you adjust your +be wrong and jump forwards and backwards, e.g. when you adjust your clock. =item watcher @@ -5230,5 +5239,5 @@ to be started (attached to an event loop) before they can receive events. =head1 AUTHOR Marc Lehmann , with repeated corrections by Mikael -Magnusson and Emanuele Giaquinta. +Magnusson and Emanuele Giaquinta, and minor corrections by many others. diff --git a/deps/libev/ev_epoll.c b/deps/libev/ev_epoll.c index d0caa93e7c..5deb652111 100644 --- a/deps/libev/ev_epoll.c +++ b/deps/libev/ev_epoll.c @@ -6,14 +6,14 @@ * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO @@ -148,7 +148,7 @@ epoll_poll (EV_P_ ev_tstamp timeout) /* the default libev max wait time, however. */ EV_RELEASE_CB; eventcnt = epoll_wait (backend_fd, epoll_events, epoll_eventmax, - epoll_epermcnt ? 0 : (int)ceil (timeout * 1000.)); + epoll_epermcnt ? 0 : ev_timeout_to_ms (timeout)); EV_ACQUIRE_CB; if (expect_false (eventcnt < 0)) diff --git a/deps/libev/ev_kqueue.c b/deps/libev/ev_kqueue.c index 0d809f5ee8..1b526d1c7b 100644 --- a/deps/libev/ev_kqueue.c +++ b/deps/libev/ev_kqueue.c @@ -6,14 +6,14 @@ * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO @@ -103,12 +103,12 @@ kqueue_poll (EV_P_ ev_tstamp timeout) kqueue_changecnt = 0; if (expect_false (res < 0)) - { + { if (errno != EINTR) ev_syserr ("(libev) kevent"); return; - } + } for (i = 0; i < res; ++i) { diff --git a/deps/libev/ev_poll.c b/deps/libev/ev_poll.c index 81e4b53ba9..e53ae0de93 100644 --- a/deps/libev/ev_poll.c +++ b/deps/libev/ev_poll.c @@ -1,19 +1,19 @@ /* * libev poll fd activity backend * - * Copyright (c) 2007,2008,2009,2010 Marc Alexander Lehmann + * Copyright (c) 2007,2008,2009,2010,2011 Marc Alexander Lehmann * All rights reserved. * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO @@ -92,7 +92,7 @@ poll_poll (EV_P_ ev_tstamp timeout) int res; EV_RELEASE_CB; - res = poll (polls, pollcnt, (int)ceil (timeout * 1000.)); + res = poll (polls, pollcnt, ev_timeout_to_ms (timeout)); EV_ACQUIRE_CB; if (expect_false (res < 0)) diff --git a/deps/libev/ev_port.c b/deps/libev/ev_port.c index 9044ef776f..0ffebc3726 100644 --- a/deps/libev/ev_port.c +++ b/deps/libev/ev_port.c @@ -1,19 +1,19 @@ /* * libev solaris event port backend * - * Copyright (c) 2007,2008,2009,2010 Marc Alexander Lehmann + * Copyright (c) 2007,2008,2009,2010,2011 Marc Alexander Lehmann * All rights reserved. * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO diff --git a/deps/libev/ev_select.c b/deps/libev/ev_select.c index 76ffa86b3b..0ea9467e40 100644 --- a/deps/libev/ev_select.c +++ b/deps/libev/ev_select.c @@ -6,14 +6,14 @@ * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO @@ -39,8 +39,11 @@ #ifndef _WIN32 /* for unix systems */ -# include # include +# ifndef __hpux +/* for REAL unix systems */ +# include +# endif #endif #ifndef EV_SELECT_USE_FD_SET @@ -280,10 +283,10 @@ select_init (EV_P_ int flags) #endif #else vec_max = 0; - vec_ri = 0; - vec_ro = 0; - vec_wi = 0; - vec_wo = 0; + vec_ri = 0; + vec_ro = 0; + vec_wi = 0; + vec_wo = 0; #ifdef _WIN32 vec_eo = 0; #endif diff --git a/deps/libev/ev_vars.h b/deps/libev/ev_vars.h index 17d77c890e..5ee3ed1b2a 100644 --- a/deps/libev/ev_vars.h +++ b/deps/libev/ev_vars.h @@ -6,14 +6,14 @@ * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO diff --git a/deps/libev/ev_win32.c b/deps/libev/ev_win32.c index ee60ae6565..338886efe4 100644 --- a/deps/libev/ev_win32.c +++ b/deps/libev/ev_win32.c @@ -6,14 +6,14 @@ * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO @@ -46,7 +46,7 @@ /* MSDN says this is required to handle SIGFPE */ /* my wild guess would be that using something floating-pointy is required */ /* for the crt to do something about it */ -volatile double SIGFPE_REQ = 0.0f; +volatile double SIGFPE_REQ = 0.0f; /* oh, the humanity! */ static int @@ -59,7 +59,7 @@ ev_pipe (int filedes [2]) SOCKET listener; SOCKET sock [2] = { -1, -1 }; - if ((listener = socket (AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) + if ((listener = socket (AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) return -1; addr.sin_family = AF_INET; @@ -75,7 +75,7 @@ ev_pipe (int filedes [2]) if (listen (listener, 1)) goto fail; - if ((sock [0] = socket (AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) + if ((sock [0] = socket (AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) goto fail; if (connect (sock [0], (struct sockaddr *)&addr, addr_size)) diff --git a/deps/libev/event.c b/deps/libev/event.c index 579423f18c..aaf6d534ca 100644 --- a/deps/libev/event.c +++ b/deps/libev/event.c @@ -6,14 +6,14 @@ * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO diff --git a/deps/libev/event.h b/deps/libev/event.h index 6411fb6d0d..10ff05a3cb 100644 --- a/deps/libev/event.h +++ b/deps/libev/event.h @@ -6,14 +6,14 @@ * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER- * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO diff --git a/deps/libev/libev.m4 b/deps/libev/libev.m4 index 0930c0c001..e3f4c81b23 100644 --- a/deps/libev/libev.m4 +++ b/deps/libev/libev.m4 @@ -6,7 +6,7 @@ AC_CHECK_HEADERS(sys/inotify.h sys/epoll.h sys/event.h port.h poll.h sys/select. AC_CHECK_FUNCS(inotify_init epoll_ctl kqueue port_create poll select eventfd signalfd) -AC_CHECK_FUNC(clock_gettime, [], [ +AC_CHECK_FUNCS(clock_gettime, [], [ dnl on linux, try syscall wrapper first if test $(uname) = Linux; then AC_MSG_CHECKING(for clock_gettime syscall) @@ -27,7 +27,7 @@ AC_CHECK_FUNC(clock_gettime, [], [ fi ]) -AC_CHECK_FUNC(nanosleep, [], [ +AC_CHECK_FUNCS(nanosleep, [], [ if test -z "$LIBEV_M4_AVOID_LIBRT"; then AC_CHECK_LIB(rt, nanosleep) unset ac_cv_func_nanosleep