Don't include <stdint.h>, it's not available when compiling with MSVC
2008 and we don't need it in the first place - just cast the argument
to `char *` rather than `uintptr_t`.
Fixes#893.
uv_ip6_addr() copies the address part to a temporary buffer when it
contains a link-local suffix ('<address>%<interface>'). Before this
commit, it didn't zero-terminate the address properly: it put the nul
byte at the end of the temporary buffer rather than at the end of the
address string, meaning the buffer looked like this:
<address> <garbage> '\0'
Fixes the following valgrind warning:
==16170== Conditional jump or move depends on uninitialised value(s)
==16170== at 0x43602C: inet_pton6 (inet.c:228)
==16170== by 0x435CE1: uv_inet_pton (inet.c:163)
==16170== by 0x436FD0: uv_ip6_addr (uv-common.c:175)
==16170== by 0x434717: test_ip6_addr_scope (test-ip6-addr.c:89)
==16170== by 0x43455B: call_iface_info_cb (test-ip6-addr.c:45)
==16170== by 0x43462B: foreach_ip6_interface (test-ip6-addr.c:59)
==16170== by 0x434791: run_test_ip6_addr_link_local (test-ip6-add
==16170== by 0x4061E8: run_test_part (runner.c:396)
==16170== by 0x404F4B: main (run-tests.c:58)
==16170==
==16170== Conditional jump or move depends on uninitialised value(s)
==16170== at 0x4C2AD8A: __GI_strchr (mc_replace_strmem.c:224)
==16170== by 0x435ECB: inet_pton6 (inet.c:231)
==16170== by 0x435CE1: uv_inet_pton (inet.c:163)
==16170== by 0x436FD0: uv_ip6_addr (uv-common.c:175)
==16170== by 0x434717: test_ip6_addr_scope (test-ip6-addr.c:89)
==16170== by 0x43455B: call_iface_info_cb (test-ip6-addr.c:45)
==16170== by 0x43462B: foreach_ip6_interface (test-ip6-addr.c:59)
==16170== by 0x434791: run_test_ip6_addr_link_local (test-ip6-add
==16170== by 0x4061E8: run_test_part (runner.c:396)
==16170== by 0x404F4B: main (run-tests.c:58)
Fixes#890.
Include <errno.h> and <stdlib.h>. They're being pulled in implicitly
on OS X but apparently that's not the case with iOS builds.
Build breakage introduced in 5ff6f85 by yours truly. Mea culpa.
Fixes#885 and #891.
Before this commit, libuv would abort() if waitpid() failed with EINTR.
It's unlikely that anyone actually hit this error condition: the major
UNIX platforms - with the possible exception of Solaris - don't return
EINTR when the WNOHANG flag is specified, as libuv does.
However, POSIX allows for an implementation to do whatever here: unless
explicitly forbidden, it's allowed and POSIX doesn't restrict
implementers in this particular area.
Let's opt for robustness and handle EINTR.
The fsevents watcher thread only needs a minimal amount of stack space
in order to run. Restrict its stack size so there's more address space
left for the libuv user.
* Move CF run loop code to fsevents.c.
* Create the fsevents thread on demand rather than at startup.
* Remove use of ACCESS_ONCE. All accesses to loop->cf_loop are
protected by full memory barriers so no reordering can take place.
Fixes#872.
Fixes the following warning:
src\uv-common.c(476): warning C4715:
'uv__getaddrinfo_translate_error' : not all control paths return
a value
The function never returns - the final statement is a call to abort() -
but it seems MSVC's program flow analyzer is too weak to figure that
out.
mingw32 doesn't have the JOB_OBJECT_XXX defines. Provide them ourselves
when they are not already defined.
This is possibly only an issue with older versions of mingw32 because
mingw-w64 2.0 _does_ export the defines.
Change the uv_fs_write() prototype so the 'buf' argument is now
`const void*` rather than `void*`.
The argument is stored in a non-const field in the uv_fs_t but that's
inconsequential because the memory it points to is not touched.
* add a very simple Makefile.mingw that builds libuv.a
* apply a couple of fixes to src/win so it actually builds with mingw
(mostly missing includes)
Fixes#847.
Make it possible for the libuv user to handle out of memory conditions
gracefully. When alloc_cb() returns a buffer with len==0, call the read
or recv callback with nread=UV_ENOBUFS. It's up to the user to stop or
close the handle.
Fixes#752.
Before this commit, uv_fs_chown() and uv_fs_fchown() took the uid and
gid as signed integers which is wrong because uid_t and gid_t are
unsigned on most all platforms and IDs that don't fit in a signed
integer do exist.
This is not an ABI change because the size of the uid and gid arguments
do not change, only their sign.
On Windows, uv_uid_t and uv_gid_t are typedef'd as unsigned char for
reasons that are unclear. It doesn't matter: they get cast to ints when
used as function arguments. The arguments themselves are unused.
Partial fix for joyent/node#5890.
This commit changes the libuv API to return error codes directly rather
than storing them in a loop-global field.
A code snippet like this one:
if (uv_foo(loop) < 0) {
uv_err_t err = uv_last_error(loop);
fprintf(stderr, "%s\n", uv_strerror(err));
}
Should be rewritten like this:
int err = uv_foo(loop);
if (err < 0)
fprintf(stderr, "%s\n", uv_strerror(err));
The rationale for this change is that it should make creating bindings
for other languages a lot easier: dealing with struct return values is
painful with most FFIs and often downright buggy.
Switch to the build tool everyone loves to hate. The Makefile has
served us well over the years but it's been acquiring more and more
features that autotools gives us for free, like easy static+shared
library building, sane install targets, and so on.
This commit drops MinGW support. If there is demand for it, we'll
re-add it.