Commit Graph

1397 Commits

Author SHA1 Message Date
Timothy J Fontaine
abcad99e23 Now working on v0.11.9 2013-08-21 10:25:40 -07:00
Timothy J Fontaine
a5260462db 2013.08.22, Version 0.11.8 (Unstable)
Changes since version 0.11.7:

* unix: fix missing return value warning in stream.c (Ben Noordhuis)

* build: serial-tests was added in automake v1.12 (Ben Noordhuis)

* windows: fix uninitialized local variable warning (Ben Noordhuis)

* windows: fix missing return value warning (Ben Noordhuis)

* build: fix string comparisons in autogen.sh (Ben Noordhuis)

* windows: move INLINE macro, remove UNUSED (Ben Noordhuis)

* unix: clean up __attribute__((quux)) usage (Ben Noordhuis)

* sunos: remove futimes() macro (Ben Noordhuis)

* unix: fix uv__signal_unlock() prototype (Ben Noordhuis)

* unix, windows: allow NULL async callback (Ben Noordhuis)

* build: apply dtrace -G to all object files (Timothy J. Fontaine)

* darwin: fix indentation in uv__hrtime() (Ben Noordhuis)

* darwin: create fsevents thread on demand (Ben Noordhuis)

* darwin: reduce fsevents thread stack size (Ben Noordhuis)

* darwin: call pthread_setname_np() if available (Ben Noordhuis)

* build: fix automake serial-tests check again (Ben Noordhuis)

* unix: retry waitpid() on EINTR (Ben Noordhuis)

* darwin: fix ios build error (Ben Noordhuis)

* darwin: fix ios compiler warning (Ben Noordhuis)

* test: simplify test-ip6-addr.c (Ben Noordhuis)

* unix, windows: fix ipv6 link-local address parsing (Ben Noordhuis)

* fsevents: FSEvents is most likely not thread-safe (Fedor Indutny)

* windows: omit stdint.h, fix msvc 2008 build error (Ben Noordhuis)
2013-08-21 10:25:37 -07:00
Ben Noordhuis
8531046a86 windows: omit stdint.h, fix msvc 2008 build error
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.
2013-08-20 14:06:35 +02:00
Fedor Indutny
303ae3b958 fsevents: FSEvents is most likely not thread-safe
Perform all operation with FSEventStream in the same thread, where it'll
be used.
2013-08-20 13:04:47 +04:00
Ben Noordhuis
602b1c69e1 unix, windows: fix ipv6 link-local address parsing
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.
2013-08-19 22:38:51 +02:00
Ben Noordhuis
12bad62add darwin: fix ios compiler warning
uv__fsevents_loop_delete() returns void. Remove the 'return 0'
statement.
2013-08-19 13:27:25 +02:00
Ben Noordhuis
b03192ed6f darwin: fix ios build error
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.
2013-08-19 13:26:57 +02:00
Ben Noordhuis
389fc448df Merge remote-tracking branch 'origin/v0.10' 2013-08-18 17:48:52 +02:00
Ben Noordhuis
b2ac4d3bf4 unix: retry waitpid() on EINTR
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.
2013-08-18 17:45:52 +02:00
Ben Noordhuis
5ff6f85f58 darwin: call pthread_setname_np() if available
When setting the process title, also call pthread_setname_np() when
supported (OS X >= 10.6 and iOS >= 3.2.)
2013-08-15 21:52:26 +02:00
Ben Noordhuis
c82e7033a5 darwin: reduce fsevents thread stack size
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.
2013-08-13 11:42:04 +02:00
Ben Noordhuis
06c4fa67ed darwin: create fsevents thread on demand
* 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.
2013-08-13 11:41:48 +02:00
Ben Noordhuis
ffcf5d1a7f darwin: fix indentation in uv__hrtime() 2013-08-13 11:39:56 +02:00
Ben Noordhuis
1510ce81fd unix, windows: allow NULL async callback
Allow a NULL callback so the user doesn't have to provide a dummy when
the actual event is processed by e.g. a check handle callback.
2013-08-12 08:55:51 +02:00
Ben Noordhuis
c6adab2e27 unix: fix uv__signal_unlock() prototype 2013-08-12 07:55:34 +02:00
Ben Noordhuis
1920513735 sunos: remove futimes() macro
Remove a macro from src/unix/internal.h that aliases futimes() to
futimesat(). Deal with the platform inconsistency in src/unix/fs.c.
2013-08-12 07:46:22 +02:00
Ben Noordhuis
fd23dbf5c6 unix: clean up __attribute__((quux)) usage
Macro-ify __attribute__((destructor)) and __attribute__((unused)).

The macros are no-ops when the compiler does not support function
attributes.
2013-08-12 07:41:49 +02:00
Ben Noordhuis
1e500266eb windows: move INLINE macro, remove UNUSED
Move the INLINE macro from src/uv-common.h to src/win/internal.h, it's
not used in src/unix/ or src/

Remove the UNUSED macro. It's, well, unused.
2013-08-12 07:22:19 +02:00
Ben Noordhuis
db1dccb9ec windows: fix missing return value warning
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.
2013-08-09 19:06:31 +02:00
Ben Noordhuis
85b92ad5bf windows: fix uninitialized local variable warning
Pass the user-returned buffer to the read calback. Fixes the following
warning:

    src\win\tcp.c(439): warning C4700: uninitialized local variable
    'buf'
2013-08-09 19:00:52 +02:00
Ben Noordhuis
6837e480fd unix: fix missing return value warning in stream.c 2013-08-08 21:10:37 +02:00
Ben Noordhuis
d34fad7325 Now working on v0.11.8 2013-08-06 23:19:01 +02:00
Ben Noordhuis
3cad361f87 2013.08.07, Version 0.11.7 (Unstable)
Changes since version 0.11.6:

* unix, windows: fix uv_fs_chown() function prototype (Ben Noordhuis)

* unix, windows: remove unused variables (Brian White)

* test: fix signed/unsigned comparison warnings (Ben Noordhuis)

* build: dtrace shouldn't break out of tree builds (Timothy J. Fontaine)

* unix, windows: don't read/recv if buf.len==0 (Ben Noordhuis)

* build: add mingw makefile (Ben Noordhuis)

* unix, windows: add MAC to uv_interface_addresses() (Brian White)

* build: enable AM_INIT_AUTOMAKE([subdir-objects]) (Ben Noordhuis)

* unix, windows: make buf arg to uv_fs_write const (Ben Noordhuis)

* sunos: fix build breakage introduced in e3a657c (Ben Noordhuis)

* aix: fix build breakage introduced in 3ee4d3f (Ben Noordhuis)

* windows: fix mingw32 build, define JOB_OBJECT_XXX (Yasuhiro Matsumoto)

* windows: fix mingw32 build, include limits.h (Yasuhiro Matsumoto)

* test: replace sprintf() with snprintf() (Ben Noordhuis)

* test: replace strcpy() with strncpy() (Ben Noordhuis)

* openbsd: fix uv_ip6_addr() unused variable warnings (Ben Noordhuis)

* openbsd: fix dlerror() const correctness warning (Ben Noordhuis)

* openbsd: fix uv_fs_sendfile() unused variable warnings (Ben Noordhuis)

* build: disable parallel automake tests (Ben Noordhuis)

* test: add windows-only snprintf() function (Ben Noordhuis)

* build: add automake serial-tests version check (Ben Noordhuis)
2013-08-06 23:18:55 +02:00
Ben Noordhuis
fb2a6d4a15 openbsd: fix uv_fs_sendfile() unused variable warnings 2013-08-05 02:45:59 +02:00
Ben Noordhuis
103969ac8e openbsd: fix dlerror() const correctness warning 2013-08-05 02:45:59 +02:00
Ben Noordhuis
f7e46379ef openbsd: fix uv_ip6_addr() unused variable warnings 2013-08-05 02:45:59 +02:00
Yasuhiro Matsumoto
d7a1ba85f2 windows: fix mingw32 build, include limits.h
src/win/process uses INT_MAX so include limits.h.
2013-08-01 15:21:35 +02:00
Yasuhiro Matsumoto
bfa3e28b0d windows: fix mingw32 build, define JOB_OBJECT_XXX
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.
2013-08-01 15:21:35 +02:00
Ben Noordhuis
4bdb7d837a aix: fix build breakage introduced in 3ee4d3f
Possibly, anyway - this change is untested. Without it, libuv
definitely won't build on AIX though.
2013-07-29 06:11:13 +02:00
Ben Noordhuis
167a817351 sunos: fix build breakage introduced in e3a657c 2013-07-29 06:08:35 +02:00
Ben Noordhuis
0e7ba080b4 unix, windows: make buf arg to uv_fs_write const
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.
2013-07-29 05:27:45 +02:00
Ben Noordhuis
3d4099ebcb Merge remote-tracking branch 'origin/v0.10'
Conflicts:
	AUTHORS
	ChangeLog
	src/version.c
	src/win/fs.c
2013-07-25 20:01:31 +02:00
Timothy J Fontaine
2744e1e009 Now working on v0.10.14 2013-07-25 10:34:41 -07:00
Timothy J Fontaine
381312e1fe 2013.07.26, Version 0.10.13 (Stable)
Changes since version 0.10.12:

* unix, windows: fix uv_fs_chown() function prototype (Ben Noordhuis)
2013-07-25 10:31:28 -07:00
Brian White
e3a657c662 unix, windows: add MAC to uv_interface_addresses()
Make uv_interface_addresses() return the MAC address as a 48 bits
binary value in the phys_addr field of the uv_interface_address_t
struct.
2013-07-25 13:49:39 +02:00
Ben Noordhuis
977e8337ba build: add mingw makefile
* 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.
2013-07-25 02:13:28 +02:00
Ben Noordhuis
1acbd768b0 unix, windows: don't read/recv if buf.len==0
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.
2013-07-25 01:32:04 +02:00
Brian White
c021ee0795 unix, windows: remove unused variables 2013-07-25 11:25:43 +02:00
Ben Noordhuis
d779eb53d5 unix, windows: fix uv_fs_chown() function prototype
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.
2013-07-23 13:24:37 +02:00
Ben Noordhuis
7e68e6d895 Now working on v0.11.7 2013-07-20 11:59:08 +02:00
Ben Noordhuis
6645b93273 2013.07.21, Version 0.11.6 (Unstable)
Changes since version 0.11.5:

* test: open stdout fd in write-only mode (Ben Noordhuis)

* windows: uv_spawn shouldn't reject reparse points (Bert Belder)

* windows: use WSAGetLastError(), not errno (Ben Noordhuis)

* build: darwin: disable -fstrict-aliasing warnings (Ben Noordhuis)

* test: fix signed/unsigned compiler warning (Ben Noordhuis)

* test: add 'start timer from check handle' test (Ben Noordhuis)

* build: `all` now builds static and dynamic lib (Ben Noordhuis)

* unix, windows: add extra fields to uv_stat_t (Saúl Ibarra Corretgé)

* build: add install target to the makefile (Navaneeth Kedaram
  Nambiathan)

* build: switch to autotools (Ben Noordhuis)

* build: use AM_PROG_AR conditionally (Ben Noordhuis)

* test: fix fs_fstat test on sunos (Ben Noordhuis)

* test: fix fs_chown when running as root (Ben Noordhuis)

* test: fix spawn_setgid_fails and spawn_setuid_fails (Ben Noordhuis)

* build: use AM_SILENT_RULES conditionally (Ben Noordhuis)

* build: add DTrace detection for autotools (Timothy J. Fontaine)

* linux,darwin,win: link-local IPv6 addresses (Miroslav Bajtoš)

* unix: fix build when !defined(PTHREAD_MUTEX_ERRORCHECK) (Ben
  Noordhuis)

* unix, windows: return error codes directly (Ben Noordhuis)
2013-07-20 11:59:03 +02:00
isaacs
3b4e0a216f Now working on v0.10.13 2013-07-09 13:18:53 -07:00
isaacs
58a46221bb 2013.07.10, Version 0.10.12 (Stable)
Changes since version 0.10.11:

* linux: add support for MIPS (Andrei Sedoi)

* windows: uv_spawn shouldn't reject reparse points (Bert Belder)

* windows: use WSAGetLastError(), not errno (Ben Noordhuis)

* build: darwin: disable -fstrict-aliasing warnings (Ben Noordhuis)

* build: `all` now builds static and dynamic lib (Ben Noordhuis)

* unix: fix build when !defined(PTHREAD_MUTEX_ERRORCHECK) (Ben
  Noordhuis)
2013-07-09 13:18:50 -07:00
Ben Noordhuis
3ee4d3f183 unix, windows: return error codes directly
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.
2013-07-07 09:51:00 +02:00
Ben Noordhuis
13f73fadff Merge remote-tracking branch 'origin/v0.10' 2013-07-05 12:15:53 +02:00
Ben Noordhuis
37d0209c89 unix: fix build when !defined(PTHREAD_MUTEX_ERRORCHECK)
Ancient versions of glibc (<= 2.3.1) don't have error-checking mutexes.
2013-07-05 12:15:08 +02:00
Miroslav Bajtoš
fd45f876ff linux,darwin,win: link-local IPv6 addresses
Modified uv_ip6_addr() to fill sin6_scope_id for link-local addresses.

Fixes #271

Conflicts:
	build.mk
2013-07-04 15:43:20 +02:00
Ben Noordhuis
ddd7e04fd6 build: switch to autotools
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.
2013-07-02 01:21:16 +02:00
Saúl Ibarra Corretgé
f9e6029b82 unix, windows: add extra fields to uv_stat_t 2013-06-28 00:42:37 +02:00
Ben Noordhuis
ce2458c053 Merge remote-tracking branch 'origin/v0.10'
Conflicts:
	test/test-fs.c
	test/test-list.h
2013-06-26 10:35:41 +02:00