Browse Source

deps: update libuv to 1.0.2

PR-URL: https://github.com/joyent/node/pull/8847
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
v0.11.15-release
Saúl Ibarra Corretgé 10 years ago
committed by Trevor Norris
parent
commit
20a7088d9c
  1. 6
      deps/uv/AUTHORS
  2. 89
      deps/uv/ChangeLog
  3. 3
      deps/uv/README.md
  4. 2
      deps/uv/configure.ac
  5. 2
      deps/uv/docs/src/conf.py
  6. 6
      deps/uv/docs/src/design.rst
  7. 2
      deps/uv/docs/src/dll.rst
  8. 5
      deps/uv/docs/src/fs.rst
  9. 2
      deps/uv/docs/src/fs_event.rst
  10. 2
      deps/uv/docs/src/fs_poll.rst
  11. 19
      deps/uv/docs/src/loop.rst
  12. 8
      deps/uv/docs/src/migration_010_100.rst
  13. 8
      deps/uv/docs/src/misc.rst
  14. 2
      deps/uv/docs/src/pipe.rst
  15. 4
      deps/uv/docs/src/stream.rst
  16. 2
      deps/uv/docs/src/threadpool.rst
  17. 2
      deps/uv/include/uv-version.h
  18. 5
      deps/uv/include/uv-win.h
  19. 4
      deps/uv/include/uv.h
  20. 4
      deps/uv/src/unix/aix.c
  21. 2
      deps/uv/src/unix/core.c
  22. 4
      deps/uv/src/unix/getaddrinfo.c
  23. 5
      deps/uv/src/unix/internal.h
  24. 17
      deps/uv/src/unix/kqueue.c
  25. 28
      deps/uv/src/unix/linux-core.c
  26. 3
      deps/uv/src/unix/linux-syscalls.c
  27. 8
      deps/uv/src/unix/linux-syscalls.h
  28. 12
      deps/uv/src/unix/loop.c
  29. 13
      deps/uv/src/unix/pipe.c
  30. 24
      deps/uv/src/unix/stream.c
  31. 29
      deps/uv/src/unix/sunos.c
  32. 3
      deps/uv/src/unix/udp.c
  33. 14
      deps/uv/src/uv-common.c
  34. 3
      deps/uv/src/uv-common.h
  35. 15
      deps/uv/src/win/core.c
  36. 4
      deps/uv/src/win/fs.c
  37. 2
      deps/uv/src/win/getaddrinfo.c
  38. 34
      deps/uv/src/win/poll.c
  39. 6
      deps/uv/src/win/process.c
  40. 6
      deps/uv/src/win/tcp.c
  41. 2
      deps/uv/src/win/thread.c
  42. 2
      deps/uv/src/win/udp.c
  43. 4
      deps/uv/src/win/util.c
  44. 7
      deps/uv/test/run-benchmarks.c
  45. 7
      deps/uv/test/run-tests.c
  46. 13
      deps/uv/test/runner-unix.c
  47. 4
      deps/uv/test/runner-win.c
  48. 2
      deps/uv/test/runner.c
  49. 10
      deps/uv/test/runner.h
  50. 2
      deps/uv/test/test-osx-select.c
  51. 6
      deps/uv/test/test-pipe-close-stdout-read-stdin.c
  52. 7
      deps/uv/test/test-tty.c

6
deps/uv/AUTHORS

@ -86,9 +86,7 @@ Nicholas Vavilov <vvnicholas@gmail.com>
Miroslav Bajtoš <miro.bajtos@gmail.com>
Sean Silva <chisophugis@gmail.com>
Wynn Wilkes <wynnw@movenetworks.com>
Linus Mårtensson <linus.martensson@sonymobile.com>
Andrei Sedoi <bsnote@gmail.com>
Navaneeth Kedaram Nambiathan <navaneethkn@gmail.com>
Alex Crichton <alex@alexcrichton.com>
Brent Cook <brent@boundary.com>
Brian Kaisner <bkize1@gmail.com>
@ -110,7 +108,6 @@ Yazhong Liu <yorkiefixer@gmail.com>
Sam Roberts <vieuxtech@gmail.com>
River Tarnell <river@loreley.flyingparchment.org.uk>
Nathan Sweet <nathanjsweet@gmail.com>
Luca Bruno <lucab@debian.org>
Trevor Norris <trev.norris@gmail.com>
Oguz Bastemur <obastemur@gmail.com>
Dylan Cali <calid1984@gmail.com>
@ -173,3 +170,6 @@ Yuri D'Elia <yuri.delia@eurac.edu>
Manos Nikolaidis <manos@shadowrobot.com>
Elijah Andrews <elijah@busbud.com>
Michael Ira Krufky <m.krufky@samsung.com>
Helge Deller <deller@gmx.de>
Joey Geralnik <jgeralnik@gmail.com>
Tim Caswell <tim@creationix.com>

89
deps/uv/ChangeLog

@ -1,3 +1,67 @@
2014.12.10, Version 1.0.2 (Stable), eec671f0059953505f9a3c9aeb7f9f31466dd7cd
Changes since version 1.0.1:
* linux: fix sigmask size arg in epoll_pwait() call (Ben Noordhuis)
* linux: handle O_NONBLOCK != SOCK_NONBLOCK case (Helge Deller)
* doc: fix spelling (Joey Geralnik)
* unix, windows: fix typos in comments (Joey Geralnik)
* test: canonicalize test runner path (Ben Noordhuis)
* test: fix compilation warnings (Saúl Ibarra Corretgé)
* test: skip tty test if detected width and height are 0 (Saúl Ibarra Corretgé)
* doc: update README with IRC channel (Saúl Ibarra Corretgé)
* Revert "unix: use cfmakeraw() for setting raw TTY mode" (Ben Noordhuis)
* doc: document how to get result of uv_fs_mkdtemp (Tim Caswell)
* unix: add flag for blocking SIGPROF during poll (Ben Noordhuis)
* unix, windows: add uv_loop_configure() function (Ben Noordhuis)
* win: keep a reference to AFD_POLL_INFO in cancel poll (Marc Schlaich)
* test: raise fd limit for OSX select test (Saúl Ibarra Corretgé)
* unix: remove overzealous assert in uv_read_stop (Saúl Ibarra Corretgé)
* unix: reset the reading flag when a stream gets EOF (Saúl Ibarra Corretgé)
* unix: stop reading if an error is produced (Saúl Ibarra Corretgé)
* cleanup: remove all dead assignments (Maciej Małecki)
* linux: return early if we have no interfaces (Maciej Małecki)
* cleanup: remove a dead increment (Maciej Małecki)
2014.12.10, Version 0.10.30 (Stable), 5a63f5e9546dca482eeebc3054139b21f509f21f
Changes since version 0.10.29:
* linux: fix sigmask size arg in epoll_pwait() call (Ben Noordhuis)
* linux: handle O_NONBLOCK != SOCK_NONBLOCK case (Helge Deller)
* doc: update project links (Ben Noordhuis)
* windows: fix compilation of tests (Marc Schlaich)
* unix: add flag for blocking SIGPROF during poll (Ben Noordhuis)
* unix, windows: add uv_loop_configure() function (Ben Noordhuis)
* win: keep a reference to AFD_POLL_INFO in cancel poll (Marc Schlaich)
2014.11.27, Version 1.0.1 (Stable), 0a8e81374e861d425b56c45c8599595d848911d2
Changes since version 1.0.0:
@ -85,6 +149,17 @@ Changes since version 1.0.0-rc1:
* windows: fix fs_write with nbufs > 1 and offset (Unknown W. Brackets)
2014.10.21, Version 0.10.29 (Stable), 2d728542d3790183417f8f122a110693cd85db14
Changes since version 0.10.28:
* darwin: allocate enough space for select() hack (Fedor Indutny)
* linux: try epoll_pwait if epoll_wait is missing (Michael Hudson-Doyle)
* windows: map ERROR_INVALID_DRIVE to UV_ENOENT (Saúl Ibarra Corretgé)
2014.09.18, Version 1.0.0-rc1 (Unstable), 0c28bbf7b42882853d1799ab96ff68b07f7f8d49
Changes since version 0.11.29:
@ -273,6 +348,20 @@ Changes since version 0.11.26:
* windows: relay TCP bind errors via ipc (Alexis Campailla)
2014.07.32, Version 0.10.28 (Stable), 9c14b616f5fb84bfd7d45707bab4bbb85894443e
Changes since version 0.10.27:
* windows: fix handling closed socket while poll handle is closing (Saúl Ibarra
Corretgé)
* unix: return system error on EAI_SYSTEM (Saúl Ibarra Corretgé)
* unix: fix bogus structure field name (Saúl Ibarra Corretgé)
* darwin: invoke `mach_timebase_info` only once (Fedor Indutny)
2014.06.28, Version 0.11.26 (Unstable), 115281a1058c4034d5c5ccedacb667fe3f6327ea
Changes since version 0.11.25:

3
deps/uv/README.md

@ -36,12 +36,13 @@ used by [Luvit](http://luvit.io/), [Julia](http://julialang.org/),
## Versioning
Starting with version 1.0.0 libuv follows the [semantic versioning](http://semver.org/)
scheme. The API change and backwards compatiblity rules are those indicated by
scheme. The API change and backwards compatibility rules are those indicated by
SemVer. libuv will keep a stable ABI across major releases.
## Community
* [Mailing list](http://groups.google.com/group/libuv)
* [IRC chatroom (#libuv@irc.freenode.org)](http://webchat.freenode.net?channels=libuv&uio=d4)
## Documentation

2
deps/uv/configure.ac

@ -13,7 +13,7 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
AC_PREREQ(2.57)
AC_INIT([libuv], [1.0.1], [https://github.com/libuv/libuv/issues])
AC_INIT([libuv], [1.0.2], [https://github.com/libuv/libuv/issues])
AC_CONFIG_MACRO_DIR([m4])
m4_include([m4/libuv-extra-automake-flags.m4])
m4_include([m4/as_case.m4])

2
deps/uv/docs/src/conf.py

@ -261,7 +261,7 @@ man_pages = [
# dir menu entry, description, category)
texinfo_documents = [
('index', 'libuv', u'libuv API documentation',
u'libuv contributors', 'libuv', 'Cross-platform asychronous I/O',
u'libuv contributors', 'libuv', 'Cross-platform asynchronous I/O',
'Miscellaneous'),
]

6
deps/uv/docs/src/design.rst

@ -8,7 +8,7 @@ libuv is cross-platform support library which was originally written for NodeJS.
around the event-driven asynchronous I/O model.
The library provides much more than simply abstraction over different I/O polling mechanisms:
'handles' and 'streams' provde a high level abstraction for sockets and other entities;
'handles' and 'streams' provide a high level abstraction for sockets and other entities;
cross-platform file I/O and threading functionality is also provided, amongst other things.
Here is a diagram illustrating the different parts that compose libuv and what subsystem they
@ -42,7 +42,7 @@ operations, and it's meant to be tied to a single thread. One can run multiple e
as long as each runs in a different thread. The libuv event loop (or any other API involving
the loop or handles, for that matter) **is not thread-safe** except stated otherwise.
The event loop follows the rather usual single threaded asynchronous I/O approah: all (network)
The event loop follows the rather usual single threaded asynchronous I/O approach: all (network)
I/O is performed on non-blocking sockets which are polled using the best mechanism available
on the given platform: epoll on Linux, kqueue on OSX and other BSDs, event ports on SunOS and IOCP
on Windows. As part of a loop iteration the loop will block waiting for I/O activity on sockets
@ -104,7 +104,7 @@ stages of a loop iteration:
#. Iteration ends. If the loop was run with ``UV_RUN_NOWAIT`` or ``UV_RUN_ONCE`` modes the
iteration is ended and :c:func:`uv_run` will return. If the loop was run with ``UV_RUN_DEFAULT``
it will contionue from the start if it's asill *alive*, otherwise it will also end.
it will continue from the start if it's still *alive*, otherwise it will also end.
.. important::

2
deps/uv/docs/src/dll.rst

@ -4,7 +4,7 @@
Shared library handling
=======================
libuv prodives cross platform utilities for loading shared libraries and
libuv provides cross platform utilities for loading shared libraries and
retrieving symbols from them, using the following API.

5
deps/uv/docs/src/fs.rst

@ -191,6 +191,9 @@ API
Equivalent to ``mkdtemp(3)``.
.. note::
The result can be found as a null terminated string at `req->path`.
.. c:function:: int uv_fs_rmdir(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb)
Equivalent to ``rmdir(2)``.
@ -258,7 +261,7 @@ API
* ``UV_FS_SYMLINK_DIR``: indicates that `path` points to a directory.
* ``UV_FS_SYMLINK_JUNCTION``: request that the symlink is created
using junktion points.
using junction points.
.. c:function:: int uv_fs_readlink(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb)

2
deps/uv/docs/src/fs_event.rst

@ -95,7 +95,7 @@ API
Get the path being monitored by the handle. The buffer must be preallocated
by the user. Returns 0 on success or an error code < 0 in case of failure.
On sucess, `buf` will contain the path and `len` its length. If the buffer
On success, `buf` will contain the path and `len` its length. If the buffer
is not big enough UV_ENOBUFS will be returned and len will be set to the
required size.

2
deps/uv/docs/src/fs_poll.rst

@ -62,7 +62,7 @@ API
Get the path being monitored by the handle. The buffer must be preallocated
by the user. Returns 0 on success or an error code < 0 in case of failure.
On sucess, `buf` will contain the path and `len` its length. If the buffer
On success, `buf` will contain the path and `len` its length. If the buffer
is not big enough UV_ENOBUFS will be returned and len will be set to the
required size.

19
deps/uv/docs/src/loop.rst

@ -50,6 +50,23 @@ API
Initializes the given `uv_loop_t` structure.
.. c:function:: int uv_loop_configure(uv_loop_t* loop, uv_loop_option option, ...)
Set additional loop options. You should normally call this before the
first call to :c:func:`uv_run` unless mentioned otherwise.
Returns 0 on success or a UV_E* error code on failure. Be prepared to
handle UV_ENOSYS; it means the loop option is not supported by the platform.
Supported options:
- UV_LOOP_BLOCK_SIGNAL: Block a signal when polling for new events. The
second argument to :c:func:`uv_loop_configure` is the signal number.
This operation is currently only implemented for SIGPROF signals,
to suppress unnecessary wakeups when using a sampling profiler.
Requesting other signals will fail with UV_EINVAL.
.. c:function:: int uv_loop_close(uv_loop_t* loop)
Closes all internal loop resources. This function must only be called once
@ -59,7 +76,7 @@ API
.. c:function:: uv_loop_t* uv_default_loop(void)
Returns the initialized default loop. It may return NULL in case of
allocation failture.
allocation failure.
.. c:function:: int uv_run(uv_loop_t* loop, uv_run_mode mode)

8
deps/uv/docs/src/migration_010_100.rst

@ -80,7 +80,7 @@ In libuv 0.10 Unix used a threadpool which defaulted to 4 threads, while Windows
threads per process.
In 1.0, we unified both implementations, so Windows now uses the same implementation Unix
does. The threadppol size can be set by exporting the ``UV_THREADPOOL_SIZE`` environment
does. The threadpool size can be set by exporting the ``UV_THREADPOOL_SIZE`` environment
variable. See :c:ref:`threadpool`.
@ -95,7 +95,7 @@ In libuv 0.10 the callback had to return a filled :c:type:`uv_buf_t` by value:
return uv_buf_init(malloc(size), size);
}
In libuv 1.0 a pointer to a buffer is passed to the callbck, which the user
In libuv 1.0 a pointer to a buffer is passed to the callback, which the user
needs to fill:
::
@ -200,7 +200,7 @@ for such function looked like this:
...
}
In libuv 1.0, `uv_read2_start` was removed, and the user needs to check if there are penging
In libuv 1.0, `uv_read2_start` was removed, and the user needs to check if there are pending
handles using :c:func:`uv_pipe_pending_count` and :c:func:`uv_pipe_pending_type` while in
the read callback:
@ -222,7 +222,7 @@ Extracting the file descriptor out of a handle
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
While it wasn't supported by the API, users often accessed the libuv internals in
order to get access to the file descript of a TCP handle, for example.
order to get access to the file descriptor of a TCP handle, for example.
::

8
deps/uv/docs/src/misc.rst

@ -1,10 +1,10 @@
.. _misc:
Miscelaneous utilities
Miscellaneous utilities
======================
This section contains miscelaneous functions that don't really belong in any
This section contains miscellaneous functions that don't really belong in any
other section.
@ -186,11 +186,11 @@ API
.. c:function:: int uv_ip4_name(const struct sockaddr_in* src, char* dst, size_t size)
Convert a binary structure containing an IPv4 addres to a string.
Convert a binary structure containing an IPv4 address to a string.
.. c:function:: int uv_ip6_name(const struct sockaddr_in6* src, char* dst, size_t size)
Convert a binary structure containing an IPv6 addres to a string.
Convert a binary structure containing an IPv6 address to a string.
.. c:function:: int uv_inet_ntop(int af, const void* src, char* dst, size_t size)
.. c:function:: int uv_inet_pton(int af, const char* src, void* dst)

2
deps/uv/docs/src/pipe.rst

@ -39,7 +39,7 @@ API
Open an existing file descriptor or HANDLE as a pipe.
.. note::
The user is responsible for setting the dile descriptor in non-blocking mode.
The user is responsible for setting the file descriptor in non-blocking mode.
.. c:function:: int uv_pipe_bind(uv_pipe_t* handle, const char* name)

4
deps/uv/docs/src/stream.rst

@ -62,7 +62,7 @@ Data types
Callback called when a stream server has received an incoming connection.
The user can accept the connection by calling :c:func:`uv_accept`.
`status` will de 0 in case of success, < 0 otherwise.
`status` will be 0 in case of success, < 0 otherwise.
Public members
@ -200,7 +200,7 @@ API
When blocking mode is enabled all writes complete synchronously. The
interface remains unchanged otherwise, e.g. completion or failure of the
operation will still be reported through a callback which is made
asychronously.
asynchronously.
.. warning::
Relying too much on this API is not recommended. It is likely to change

2
deps/uv/docs/src/threadpool.rst

@ -5,7 +5,7 @@ Thread pool work scheduling
===========================
libuv provides a threadpool which can be used to run user code and get notified
in the loop thread. This thread pool is internally used to run al filesystem
in the loop thread. This thread pool is internally used to run all filesystem
operations, as well as getaddrinfo and getnameinfo requests.
Its default size is 4, but it can be changed at startup time by setting the

2
deps/uv/include/uv-version.h

@ -32,7 +32,7 @@
#define UV_VERSION_MAJOR 1
#define UV_VERSION_MINOR 0
#define UV_VERSION_PATCH 1
#define UV_VERSION_PATCH 2
#define UV_VERSION_IS_RELEASE 1
#define UV_VERSION_SUFFIX ""

5
deps/uv/include/uv-win.h

@ -517,7 +517,10 @@ RB_HEAD(uv_timer_tree_s, uv_timer_s);
/* Used in fast mode */ \
SOCKET peer_socket; \
AFD_POLL_INFO afd_poll_info_1; \
AFD_POLL_INFO afd_poll_info_2; \
union { \
AFD_POLL_INFO* afd_poll_info_ptr; \
AFD_POLL_INFO afd_poll_info; \
} afd_poll_info_2; \
/* Used in fast and slow mode. */ \
uv_req_t poll_req_1; \
uv_req_t poll_req_2; \

4
deps/uv/include/uv.h

@ -229,6 +229,9 @@ typedef struct uv_cpu_info_s uv_cpu_info_t;
typedef struct uv_interface_address_s uv_interface_address_t;
typedef struct uv_dirent_s uv_dirent_t;
typedef enum {
UV_LOOP_BLOCK_SIGNAL
} uv_loop_option;
typedef enum {
UV_RUN_DEFAULT = 0,
@ -257,6 +260,7 @@ UV_EXTERN uv_loop_t* uv_loop_new(void);
UV_EXTERN void uv_loop_delete(uv_loop_t*);
UV_EXTERN size_t uv_loop_size(void);
UV_EXTERN int uv_loop_alive(const uv_loop_t* loop);
UV_EXTERN int uv_loop_configure(uv_loop_t* loop, uv_loop_option option, ...);
UV_EXTERN int uv_run(uv_loop_t*, uv_run_mode mode);
UV_EXTERN void uv_stop(uv_loop_t*);

4
deps/uv/src/unix/aix.c

@ -151,7 +151,7 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
* Could maybe mod if we knew for sure no events are removed, but
* content of w->events is handled above as not reliable (falls back)
* so may require a pollset_query() which would have to be pretty cheap
* compared to a PS_DELETE to be worth optimising. Alternatively, could
* compared to a PS_DELETE to be worth optimizing. Alternatively, could
* lazily remove events, squelching them in the mean time. */
pc.cmd = PS_DELETE;
if (pollset_ctl(loop->backend_fd, &pc, 1)) {
@ -332,7 +332,7 @@ int uv_exepath(char* buffer, size_t* size) {
res = readlink(symlink, temp_buffer, PATH_MAX-1);
/* if readlink fails, it is a normal file just copy symlink to the
* outbut buffer.
* output buffer.
*/
if (res < 0) {
assert(*size > strlen(symlink));

2
deps/uv/src/unix/core.c

@ -325,7 +325,7 @@ int uv_run(uv_loop_t* loop, uv_run_mode mode) {
uv__run_closing_handles(loop);
if (mode == UV_RUN_ONCE) {
/* UV_RUN_ONCE implies forward progess: at least one callback must have
/* UV_RUN_ONCE implies forward progress: at least one callback must have
* been invoked when it returns. uv__io_poll() can return without doing
* I/O (meaning: no callbacks) when its timeout expires - which means we
* have pending timers that satisfy the forward progress constraint.

4
deps/uv/src/unix/getaddrinfo.c

@ -182,10 +182,8 @@ int uv_getaddrinfo(uv_loop_t* loop,
len += service_len;
}
if (hostname) {
if (hostname)
req->hostname = memcpy(buf + len, hostname, hostname_len);
len += hostname_len;
}
uv__work_submit(loop,
&req->work_req,

5
deps/uv/src/unix/internal.h

@ -146,6 +146,11 @@ enum {
UV_HANDLE_IPV6 = 0x10000 /* Handle is bound to a IPv6 socket. */
};
/* loop flags */
enum {
UV_LOOP_BLOCK_SIGPROF = 1
};
typedef enum {
UV_CLOCK_PRECISE = 0, /* Use the highest resolution clock available. */
UV_CLOCK_FAST = 1 /* Use the fastest clock with <= 1ms granularity. */

17
deps/uv/src/unix/kqueue.c

@ -55,9 +55,11 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
unsigned int nevents;
unsigned int revents;
QUEUE* q;
uv__io_t* w;
sigset_t* pset;
sigset_t set;
uint64_t base;
uint64_t diff;
uv__io_t* w;
int filter;
int fflags;
int count;
@ -117,6 +119,13 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
w->events = w->pevents;
}
pset = NULL;
if (loop->flags & UV_LOOP_BLOCK_SIGPROF) {
pset = &set;
sigemptyset(pset);
sigaddset(pset, SIGPROF);
}
assert(timeout >= -1);
base = loop->time;
count = 48; /* Benchmarks suggest this gives the best throughput. */
@ -127,6 +136,9 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
spec.tv_nsec = (timeout % 1000) * 1000000;
}
if (pset != NULL)
pthread_sigmask(SIG_BLOCK, pset, NULL);
nfds = kevent(loop->backend_fd,
events,
nevents,
@ -134,6 +146,9 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
ARRAY_SIZE(events),
timeout == -1 ? NULL : &spec);
if (pset != NULL)
pthread_sigmask(SIG_UNBLOCK, pset, NULL);
/* Update loop->time unconditionally. It's tempting to skip the update when
* timeout == 0 (i.e. non-blocking poll) but there is no guarantee that the
* operating system didn't reschedule our process while in the syscall.

28
deps/uv/src/unix/linux-core.c

@ -33,6 +33,7 @@
#include <sys/prctl.h>
#include <sys/sysinfo.h>
#include <unistd.h>
#include <signal.h>
#include <fcntl.h>
#include <time.h>
@ -141,6 +142,8 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
struct uv__epoll_event e;
QUEUE* q;
uv__io_t* w;
sigset_t* pset;
sigset_t set;
uint64_t base;
uint64_t diff;
int nevents;
@ -191,12 +194,25 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
w->events = w->pevents;
}
pset = NULL;
if (loop->flags & UV_LOOP_BLOCK_SIGPROF) {
pset = &set;
sigemptyset(pset);
sigaddset(pset, SIGPROF);
}
assert(timeout >= -1);
base = loop->time;
count = 48; /* Benchmarks suggest this gives the best throughput. */
for (;;) {
if (!no_epoll_wait) {
if (no_epoll_wait || pset != NULL) {
nfds = uv__epoll_pwait(loop->backend_fd,
events,
ARRAY_SIZE(events),
timeout,
pset);
} else {
nfds = uv__epoll_wait(loop->backend_fd,
events,
ARRAY_SIZE(events),
@ -205,12 +221,6 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
no_epoll_wait = 1;
continue;
}
} else {
nfds = uv__epoll_pwait(loop->backend_fd,
events,
ARRAY_SIZE(events),
timeout,
NULL);
}
/* Update loop->time unconditionally. It's tempting to skip the update when
@ -744,6 +754,7 @@ int uv_interface_addresses(uv_interface_address_t** addresses,
return -errno;
*count = 0;
*addresses = NULL;
/* Count the number of interfaces */
for (ent = addrs; ent != NULL; ent = ent->ifa_next) {
@ -756,6 +767,9 @@ int uv_interface_addresses(uv_interface_address_t** addresses,
(*count)++;
}
if (*count == 0)
return 0;
*addresses = malloc(*count * sizeof(**addresses));
if (!(*addresses))
return -ENOMEM;

3
deps/uv/src/unix/linux-syscalls.c

@ -21,6 +21,7 @@
#include "linux-syscalls.h"
#include <unistd.h>
#include <signal.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <errno.h>
@ -328,7 +329,7 @@ int uv__epoll_pwait(int epfd,
nevents,
timeout,
sigmask,
sizeof(*sigmask));
_NSIG / 8);
#else
return errno = ENOSYS, -1;
#endif

8
deps/uv/src/unix/linux-syscalls.h

@ -44,7 +44,7 @@
#if defined(__alpha__)
# define UV__O_NONBLOCK 0x4
#elif defined(__hppa__)
# define UV__O_NONBLOCK 0x10004
# define UV__O_NONBLOCK O_NONBLOCK
#elif defined(__mips__)
# define UV__O_NONBLOCK 0x80
#elif defined(__sparc__)
@ -60,7 +60,11 @@
#define UV__IN_NONBLOCK UV__O_NONBLOCK
#define UV__SOCK_CLOEXEC UV__O_CLOEXEC
#define UV__SOCK_NONBLOCK UV__O_NONBLOCK
#if defined(SOCK_NONBLOCK)
# define UV__SOCK_NONBLOCK SOCK_NONBLOCK
#else
# define UV__SOCK_NONBLOCK UV__O_NONBLOCK
#endif
/* epoll flags */
#define UV__EPOLL_CLOEXEC UV__O_CLOEXEC

12
deps/uv/src/unix/loop.c

@ -192,3 +192,15 @@ static void uv__loop_close(uv_loop_t* loop) {
loop->watchers = NULL;
loop->nwatchers = 0;
}
int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap) {
if (option != UV_LOOP_BLOCK_SIGNAL)
return UV_ENOSYS;
if (va_arg(ap, int) != SIGPROF)
return UV_EINVAL;
loop->flags |= UV_LOOP_BLOCK_SIGPROF;
return 0;
}

13
deps/uv/src/unix/pipe.c

@ -44,13 +44,10 @@ int uv_pipe_bind(uv_pipe_t* handle, const char* name) {
struct sockaddr_un saddr;
const char* pipe_fname;
int sockfd;
int bound;
int err;
pipe_fname = NULL;
sockfd = -1;
bound = 0;
err = -EINVAL;
/* Already bound? */
if (uv__stream_fd(handle) >= 0)
@ -83,7 +80,6 @@ int uv_pipe_bind(uv_pipe_t* handle, const char* name) {
err = -EACCES;
goto out;
}
bound = 1;
/* Success. */
handle->pipe_fname = pipe_fname; /* Is a strdup'ed copy. */
@ -91,11 +87,9 @@ int uv_pipe_bind(uv_pipe_t* handle, const char* name) {
return 0;
out:
if (bound) {
/* unlink() before uv__close() to avoid races. */
assert(pipe_fname != NULL);
unlink(pipe_fname);
}
/* unlink() before uv__close() to avoid races. */
assert(pipe_fname != NULL);
unlink(pipe_fname);
uv__close(sockfd);
free((void*)pipe_fname);
return err;
@ -158,7 +152,6 @@ void uv_pipe_connect(uv_connect_t* req,
int r;
new_sock = (uv__stream_fd(handle) == -1);
err = -EINVAL;
if (new_sock) {
err = uv__socket(AF_UNIX, SOCK_STREAM, 0);

24
deps/uv/src/unix/stream.c

@ -549,7 +549,6 @@ int uv_accept(uv_stream_t* server, uv_stream_t* client) {
if (server->accepted_fd == -1)
return -EAGAIN;
err = 0;
switch (client->type) {
case UV_NAMED_PIPE:
case UV_TCP:
@ -951,6 +950,7 @@ static void uv__stream_eof(uv_stream_t* stream, const uv_buf_t* buf) {
uv__handle_stop(stream);
uv__stream_osx_interrupt_select(stream);
stream->read_cb(stream, UV_EOF, buf);
stream->flags &= ~UV_STREAM_READING;
}
@ -1117,8 +1117,13 @@ static void uv__read(uv_stream_t* stream) {
} else {
/* Error. User should call uv_close(). */
stream->read_cb(stream, -errno, &buf);
assert(!uv__io_active(&stream->io_watcher, UV__POLLIN) &&
"stream->read_cb(status=-1) did not call uv_close()");
if (stream->flags & UV_STREAM_READING) {
stream->flags &= ~UV_STREAM_READING;
uv__io_stop(stream->loop, &stream->io_watcher, UV__POLLIN);
if (!uv__io_active(&stream->io_watcher, UV__POLLOUT))
uv__handle_stop(stream);
uv__stream_osx_interrupt_select(stream);
}
}
return;
} else if (nread == 0) {
@ -1319,7 +1324,7 @@ int uv_write2(uv_write_t* req,
/* It's legal for write_queue_size > 0 even when the write_queue is empty;
* it means there are error-state requests in the write_completed_queue that
* will touch up write_queue_size later, see also uv__write_req_finish().
* We chould check that write_queue is empty instead but that implies making
* We could check that write_queue is empty instead but that implies making
* a write() syscall when we know that the handle is in error mode.
*/
empty_queue = (stream->write_queue_size == 0);
@ -1471,15 +1476,8 @@ int uv_read_start(uv_stream_t* stream,
int uv_read_stop(uv_stream_t* stream) {
/* Sanity check. We're going to stop the handle unless it's primed for
* writing but that means there should be some kind of write action in
* progress.
*/
assert(!uv__io_active(&stream->io_watcher, UV__POLLOUT) ||
!QUEUE_EMPTY(&stream->write_completed_queue) ||
!QUEUE_EMPTY(&stream->write_queue) ||
stream->shutdown_req != NULL ||
stream->connect_req != NULL);
if (!(stream->flags & UV_STREAM_READING))
return 0;
stream->flags &= ~UV_STREAM_READING;
uv__io_stop(stream->loop, &stream->io_watcher, UV__POLLIN);

29
deps/uv/src/unix/sunos.c

@ -122,6 +122,8 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
struct timespec spec;
QUEUE* q;
uv__io_t* w;
sigset_t* pset;
sigset_t set;
uint64_t base;
uint64_t diff;
unsigned int nfds;
@ -129,6 +131,7 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
int saved_errno;
int nevents;
int count;
int err;
int fd;
if (loop->nfds == 0) {
@ -150,6 +153,13 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
w->events = w->pevents;
}
pset = NULL;
if (loop->flags & UV_LOOP_BLOCK_SIGPROF) {
pset = &set;
sigemptyset(pset);
sigaddset(pset, SIGPROF);
}
assert(timeout >= -1);
base = loop->time;
count = 48; /* Benchmarks suggest this gives the best throughput. */
@ -165,11 +175,20 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
nfds = 1;
saved_errno = 0;
if (port_getn(loop->backend_fd,
events,
ARRAY_SIZE(events),
&nfds,
timeout == -1 ? NULL : &spec)) {
if (pset != NULL)
pthread_sigmask(SIG_BLOCK, pset, NULL);
err = port_getn(loop->backend_fd,
events,
ARRAY_SIZE(events),
&nfds,
timeout == -1 ? NULL : &spec);
if (pset != NULL)
pthread_sigmask(SIG_UNBLOCK, pset, NULL);
if (err) {
/* Work around another kernel bug: port_getn() may return events even
* on error.
*/

3
deps/uv/src/unix/udp.c

@ -278,9 +278,6 @@ int uv__udp_bind(uv_udp_t* handle,
int yes;
int fd;
err = -EINVAL;
fd = -1;
/* Check for bad flags. */
if (flags & ~(UV_UDP_IPV6ONLY | UV_UDP_REUSEADDR))
return -EINVAL;

14
deps/uv/src/uv-common.c

@ -24,6 +24,7 @@
#include <stdio.h>
#include <assert.h>
#include <stdarg.h>
#include <stddef.h> /* NULL */
#include <stdlib.h> /* malloc */
#include <string.h> /* memset */
@ -442,3 +443,16 @@ int uv_fs_scandir_next(uv_fs_t* req, uv_dirent_t* ent) {
return 0;
}
int uv_loop_configure(uv_loop_t* loop, uv_loop_option option, ...) {
va_list ap;
int err;
va_start(ap, option);
/* Any platform-agnostic options should be handled here. */
err = uv__loop_configure(loop, option, ap);
va_end(ap);
return err;
}

3
deps/uv/src/uv-common.h

@ -28,6 +28,7 @@
#define UV_COMMON_H_
#include <assert.h>
#include <stdarg.h>
#include <stddef.h>
#if defined(_MSC_VER) && _MSC_VER < 1600
@ -59,6 +60,8 @@ enum {
# define UV__HANDLE_CLOSING 0x01
#endif
int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap);
int uv__tcp_bind(uv_tcp_t* tcp,
const struct sockaddr* addr,
unsigned int addrlen,

15
deps/uv/src/win/core.c

@ -39,7 +39,7 @@
static uv_loop_t default_loop_struct;
static uv_loop_t* default_loop_ptr;
/* uv_once intialization guards */
/* uv_once initialization guards */
static uv_once_t uv_init_guard_ = UV_ONCE_INIT;
@ -103,7 +103,7 @@ static void uv_init(void) {
#endif
/* Fetch winapi function pointers. This must be done first because other
* intialization code might need these function pointers to be loaded.
* initialization code might need these function pointers to be loaded.
*/
uv_winapi_init();
@ -133,7 +133,7 @@ int uv_loop_init(uv_loop_t* loop) {
if (loop->iocp == NULL)
return uv_translate_sys_error(GetLastError());
/* To prevent uninitialized memory access, loop->time must be intialized
/* To prevent uninitialized memory access, loop->time must be initialized
* to zero before calling uv_update_time for the first time.
*/
loop->time = 0;
@ -199,7 +199,7 @@ uv_loop_t* uv_default_loop(void) {
static void uv__loop_close(uv_loop_t* loop) {
size_t i;
/* close the async handle without needeing an extra loop iteration */
/* close the async handle without needing an extra loop iteration */
assert(!loop->wq_async.async_sent);
loop->wq_async.close_cb = NULL;
uv__handle_closing(&loop->wq_async);
@ -272,6 +272,11 @@ void uv_loop_delete(uv_loop_t* loop) {
}
int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap) {
return UV_ENOSYS;
}
int uv_backend_fd(const uv_loop_t* loop) {
return -1;
}
@ -411,7 +416,7 @@ int uv_run(uv_loop_t *loop, uv_run_mode mode) {
uv_process_endgames(loop);
if (mode == UV_RUN_ONCE) {
/* UV_RUN_ONCE implies forward progess: at least one callback must have
/* UV_RUN_ONCE implies forward progress: at least one callback must have
* been invoked when it returns. uv__io_poll() can return without doing
* I/O (meaning: no callbacks) when its timeout expires - which means we
* have pending timers that satisfy the forward progress constraint.

4
deps/uv/src/win/fs.c

@ -947,7 +947,7 @@ INLINE static int fs__stat_handle(HANDLE handle, uv_stat_t* statbuf) {
*
* Currently it's based on whether the 'readonly' attribute is set, which
* makes little sense because the semantics are so different: the 'read-only'
* flag is just a way for a user to protect against accidental deleteion, and
* flag is just a way for a user to protect against accidental deletion, and
* serves no security purpose. Windows uses ACLs for that.
*
* Also people now use uv_fs_chmod() to take away the writable bit for good
@ -956,7 +956,7 @@ INLINE static int fs__stat_handle(HANDLE handle, uv_stat_t* statbuf) {
* deleted.
*
* IOW it's all just a clusterfuck and we should think of something that
* makes slighty more sense.
* makes slightly more sense.
*
* And uv_fs_chmod should probably just fail on windows or be a total no-op.
* There's nothing sensible it can do anyway.

2
deps/uv/src/win/getaddrinfo.c

@ -296,7 +296,7 @@ int uv_getaddrinfo(uv_loop_t* loop,
req->alloc = (void*)alloc_ptr;
/* convert node string to UTF16 into allocated memory and save pointer in */
/* the reques. */
/* the request. */
if (node != NULL) {
req->node = (WCHAR*)alloc_ptr;
if (uv_utf8_to_utf16(node,

34
deps/uv/src/win/poll.c

@ -79,7 +79,7 @@ static void uv__fast_poll_submit_poll_req(uv_loop_t* loop, uv_poll_t* handle) {
handle->mask_events_2 = handle->events;
} else if (handle->submitted_events_2 == 0) {
req = &handle->poll_req_2;
afd_poll_info = &handle->afd_poll_info_2;
afd_poll_info = &handle->afd_poll_info_2.afd_poll_info_ptr[0];
handle->submitted_events_2 = handle->events;
handle->mask_events_1 = handle->events;
handle->mask_events_2 = 0;
@ -119,18 +119,19 @@ static void uv__fast_poll_submit_poll_req(uv_loop_t* loop, uv_poll_t* handle) {
static int uv__fast_poll_cancel_poll_req(uv_loop_t* loop, uv_poll_t* handle) {
AFD_POLL_INFO afd_poll_info;
int result;
AFD_POLL_INFO* afd_poll_info;
DWORD result;
afd_poll_info.Exclusive = TRUE;
afd_poll_info.NumberOfHandles = 1;
afd_poll_info.Timeout.QuadPart = INT64_MAX;
afd_poll_info.Handles[0].Handle = (HANDLE) handle->socket;
afd_poll_info.Handles[0].Status = 0;
afd_poll_info.Handles[0].Events = AFD_POLL_ALL;
afd_poll_info = &handle->afd_poll_info_2.afd_poll_info_ptr[1];
afd_poll_info->Exclusive = TRUE;
afd_poll_info->NumberOfHandles = 1;
afd_poll_info->Timeout.QuadPart = INT64_MAX;
afd_poll_info->Handles[0].Handle = (HANDLE) handle->socket;
afd_poll_info->Handles[0].Status = 0;
afd_poll_info->Handles[0].Events = AFD_POLL_ALL;
result = uv_msafd_poll(handle->socket,
&afd_poll_info,
afd_poll_info,
uv__get_overlapped_dummy());
if (result == SOCKET_ERROR) {
@ -154,7 +155,7 @@ static void uv__fast_poll_process_poll_req(uv_loop_t* loop, uv_poll_t* handle,
handle->submitted_events_1 = 0;
mask_events = handle->mask_events_1;
} else if (req == &handle->poll_req_2) {
afd_poll_info = &handle->afd_poll_info_2;
afd_poll_info = &handle->afd_poll_info_2.afd_poll_info_ptr[0];
handle->submitted_events_2 = 0;
mask_events = handle->mask_events_2;
} else {
@ -546,7 +547,7 @@ int uv_poll_init_socket(uv_loop_t* loop, uv_poll_t* handle,
handle->flags |= UV_HANDLE_POLL_SLOW;
}
/* Intialize 2 poll reqs. */
/* Initialize 2 poll reqs. */
handle->submitted_events_1 = 0;
uv_req_init(loop, (uv_req_t*) &(handle->poll_req_1));
handle->poll_req_1.type = UV_POLL_REQ;
@ -557,6 +558,11 @@ int uv_poll_init_socket(uv_loop_t* loop, uv_poll_t* handle,
handle->poll_req_2.type = UV_POLL_REQ;
handle->poll_req_2.data = handle;
handle->afd_poll_info_2.afd_poll_info_ptr = malloc(sizeof(*handle->afd_poll_info_2.afd_poll_info_ptr) * 2);
if (handle->afd_poll_info_2.afd_poll_info_ptr == NULL) {
return UV_ENOMEM;
}
return 0;
}
@ -618,5 +624,9 @@ void uv_poll_endgame(uv_loop_t* loop, uv_poll_t* handle) {
assert(handle->submitted_events_1 == 0);
assert(handle->submitted_events_2 == 0);
if (handle->afd_poll_info_2.afd_poll_info_ptr) {
free(handle->afd_poll_info_2.afd_poll_info_ptr);
handle->afd_poll_info_2.afd_poll_info_ptr = NULL;
}
uv__handle_close(handle);
}

6
deps/uv/src/win/process.c

@ -1063,7 +1063,7 @@ int uv_spawn(uv_loop_t* loop,
if (options->flags & UV_PROCESS_DETACHED) {
/* Note that we're not setting the CREATE_BREAKAWAY_FROM_JOB flag. That
* means that libuv might not let you create a fully deamonized process
* means that libuv might not let you create a fully daemonized process
* when run under job control. However the type of job control that libuv
* itself creates doesn't trickle down to subprocesses so they can still
* daemonize.
@ -1141,7 +1141,7 @@ int uv_spawn(uv_loop_t* loop,
assert(!err);
/* Make the handle active. It will remain active until the exit callback */
/* iis made or the handle is closed, whichever happens first. */
/* is made or the handle is closed, whichever happens first. */
uv__handle_start(process);
/* Cleanup, whether we succeeded or failed. */
@ -1177,7 +1177,7 @@ static int uv__kill(HANDLE process_handle, int signum) {
return 0;
/* If the process already exited before TerminateProcess was called, */
/* TerminateProcess will fail with ERROR_ACESS_DENIED. */
/* TerminateProcess will fail with ERROR_ACCESS_DENIED. */
err = GetLastError();
if (err == ERROR_ACCESS_DENIED &&
GetExitCodeProcess(process_handle, &status) &&

6
deps/uv/src/win/tcp.c

@ -241,7 +241,7 @@ void uv_tcp_endgame(uv_loop_t* loop, uv_tcp_t* handle) {
* allow binding to addresses that are in use by sockets in TIME_WAIT, it
* effectively allows 'stealing' a port which is in use by another application.
*
* SO_EXCLUSIVEADDRUSE is also not good here because it does cehck all sockets,
* SO_EXCLUSIVEADDRUSE is also not good here because it does check all sockets,
* regardless of state, so we'd get an error even if the port is in use by a
* socket in TIME_WAIT state.
*
@ -590,7 +590,7 @@ int uv_tcp_listen(uv_tcp_t* handle, int backlog, uv_connection_cb cb) {
}
/* Initialize other unused requests too, because uv_tcp_endgame */
/* doesn't know how how many requests were intialized, so it will */
/* doesn't know how how many requests were initialized, so it will */
/* try to clean up {uv_simultaneous_server_accepts} requests. */
for (i = simultaneous_accepts; i < uv_simultaneous_server_accepts; i++) {
req = &handle->accept_reqs[i];
@ -1342,7 +1342,7 @@ void uv_tcp_close(uv_loop_t* loop, uv_tcp_t* tcp) {
if (uv_tcp_try_cancel_io(tcp) != 0) {
/* When cancellation is not possible, there is another option: we can */
/* close the incoming sockets, which will also cancel the accept */
/* operations. However this is not cool because we might inadvertedly */
/* operations. However this is not cool because we might inadvertently */
/* close a socket that just accepted a new connection, which will */
/* cause the connection to be aborted. */
unsigned int i;

2
deps/uv/src/win/thread.c

@ -100,7 +100,7 @@ static NOINLINE void uv__once_inner(uv_once_t* guard,
} else {
/* We lost the race. Destroy the event we created and wait for the */
/* existing one todv become signaled. */
/* existing one to become signaled. */
CloseHandle(created_event);
result = WaitForSingleObject(existing_event, INFINITE);
assert(result == WAIT_OBJECT_0);

2
deps/uv/src/win/udp.c

@ -83,7 +83,7 @@ static int uv_udp_set_socket(uv_loop_t* loop, uv_udp_t* handle, SOCKET socket,
}
if (pSetFileCompletionNotificationModes) {
/* All know windowses that support SetFileCompletionNotificationModes */
/* All known Windows that support SetFileCompletionNotificationModes */
/* have a bug that makes it impossible to use this function in */
/* conjunction with datagram sockets. We can work around that but only */
/* if the user is using the default UDP driver (AFD) and has no other */

4
deps/uv/src/win/util.c

@ -44,7 +44,7 @@
* of the console title is that it is smaller than 64K. However in practice
* it is much smaller, and there is no way to figure out what the exact length
* of the title is or can be, at least not on XP. To make it even more
* annoying, GetConsoleTitle failes when the buffer to be read into is bigger
* annoying, GetConsoleTitle fails when the buffer to be read into is bigger
* than the actual maximum length. So we make a conservative guess here;
* just don't put the novel you're writing in the title, unless the plot
* survives truncation.
@ -64,7 +64,7 @@ static double hrtime_interval_ = 0;
/*
* One-time intialization code for functionality defined in util.c.
* One-time initialization code for functionality defined in util.c.
*/
void uv__util_init() {
LARGE_INTEGER perf_frequency;

7
deps/uv/test/run-benchmarks.c

@ -33,7 +33,8 @@ static int maybe_run_test(int argc, char **argv);
int main(int argc, char **argv) {
platform_init(argc, argv);
if (platform_init(argc, argv))
return EXIT_FAILURE;
switch (argc) {
case 1: return run_tests(1);
@ -41,8 +42,10 @@ int main(int argc, char **argv) {
case 3: return run_test_part(argv[1], argv[2]);
default:
LOGF("Too many arguments.\n");
return 1;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}

7
deps/uv/test/run-tests.c

@ -46,7 +46,8 @@ static int maybe_run_test(int argc, char **argv);
int main(int argc, char **argv) {
platform_init(argc, argv);
if (platform_init(argc, argv))
return EXIT_FAILURE;
argv = uv_setup_args(argc, argv);
@ -56,8 +57,10 @@ int main(int argc, char **argv) {
case 3: return run_test_part(argv[1], argv[2]);
default:
LOGF("Too many arguments.\n");
return 1;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}

13
deps/uv/test/runner-unix.c

@ -22,10 +22,11 @@
#include "runner-unix.h"
#include "runner.h"
#include <limits.h>
#include <stdint.h> /* uintptr_t */
#include <errno.h>
#include <unistd.h> /* usleep */
#include <unistd.h> /* readlink, usleep */
#include <string.h> /* strdup */
#include <stdio.h>
#include <stdlib.h>
@ -40,7 +41,7 @@
/* Do platform-specific initialization. */
void platform_init(int argc, char **argv) {
int platform_init(int argc, char **argv) {
const char* tap;
tap = getenv("UV_TAP_OUTPUT");
@ -49,8 +50,14 @@ void platform_init(int argc, char **argv) {
/* Disable stdio output buffering. */
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);
strncpy(executable_path, argv[0], sizeof(executable_path) - 1);
signal(SIGPIPE, SIG_IGN);
if (realpath(argv[0], executable_path) == NULL) {
perror("realpath");
return -1;
}
return 0;
}

4
deps/uv/test/runner-win.c

@ -43,7 +43,7 @@
/* Do platform-specific initialization. */
void platform_init(int argc, char **argv) {
int platform_init(int argc, char **argv) {
const char* tap;
tap = getenv("UV_TAP_OUTPUT");
@ -66,6 +66,8 @@ void platform_init(int argc, char **argv) {
setvbuf(stderr, NULL, _IONBF, 0);
strcpy(executable_path, argv[0]);
return 0;
}

2
deps/uv/test/runner.c

@ -26,7 +26,7 @@
#include "task.h"
#include "uv.h"
char executable_path[PATHMAX] = { '\0' };
char executable_path[sizeof(executable_path)];
int tap_output = 0;

10
deps/uv/test/runner.h

@ -22,6 +22,7 @@
#ifndef RUNNER_H_
#define RUNNER_H_
#include <limits.h> /* PATH_MAX */
#include <stdio.h> /* FILE */
@ -83,8 +84,11 @@ typedef struct {
#define TEST_HELPER HELPER_ENTRY
#define BENCHMARK_HELPER HELPER_ENTRY
#define PATHMAX 1024
extern char executable_path[PATHMAX];
#ifdef PATH_MAX
extern char executable_path[PATH_MAX];
#else
extern char executable_path[4096];
#endif
/*
* Include platform-dependent definitions
@ -130,7 +134,7 @@ void print_tests(FILE* stream);
*/
/* Do platform-specific initialization. */
void platform_init(int argc, char** argv);
int platform_init(int argc, char** argv);
/* Invoke "argv[0] test-name [test-part]". Store process info in *p. */
/* Make sure that all stdio output of the processes is buffered up. */

2
deps/uv/test/test-osx-select.c

@ -90,6 +90,8 @@ TEST_IMPL(osx_select_many_fds) {
uv_tty_t tty;
uv_tcp_t tcps[1500];
TEST_FILE_LIMIT(ARRAY_SIZE(tcps) + 2);
r = uv_ip4_addr("127.0.0.1", 0, &addr);
ASSERT(r == 0);

6
deps/uv/test/test-pipe-close-stdout-read-stdin.c

@ -54,7 +54,8 @@ TEST_IMPL(pipe_close_stdout_read_stdin) {
int fd[2];
int status;
pipe(fd);
r = pipe(fd);
ASSERT(r == 0);
if ((pid = fork()) == 0) {
/*
@ -63,7 +64,8 @@ TEST_IMPL(pipe_close_stdout_read_stdin) {
*/
close(fd[1]);
close(0);
dup(fd[0]);
r = dup(fd[0]);
ASSERT(r != -1);
/* Create a stream that reads from the pipe. */
uv_pipe_t stdin_pipe;

7
deps/uv/test/test-tty.c

@ -96,6 +96,13 @@ TEST_IMPL(tty) {
printf("width=%d height=%d\n", width, height);
if (width == 0 && height == 0) {
/* Some environments such as containers or Jenkins behave like this
* sometimes */
MAKE_VALGRIND_HAPPY();
return TEST_SKIP;
}
/*
* Is it a safe assumption that most people have terminals larger than
* 10x10?

Loading…
Cancel
Save