Commit Graph

2358 Commits

Author SHA1 Message Date
Ben Noordhuis
a97685e702 build: add automake serial-tests version check
The serial-tests directive was added in automake v0.11. Add an ad-hoc
version check to find out if it's safe to enable. Fixes the autotools
build with older versions of automake.
2013-08-05 23:29:58 +02:00
Ben Noordhuis
fd082901f1 test: add windows-only snprintf() function
Should fix the build after 96f32a2 inadvertently broke it.

There is no snprintf() on Windows because, hey, it's a C99 addition
and the people from Redmond, WA are still firmly stuck in 1989.
2013-08-05 14:14:02 +02:00
Ben Noordhuis
35ea88cf6b build: disable parallel automake tests
Our tests are not parallelizable and besides, they're one big test
from the perspective of the automake test driver anyway. Turn on
serial mode.
2013-08-05 02:46:59 +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
Ben Noordhuis
5af98d3843 test: replace strcpy() with strncpy() 2013-08-05 02:45:40 +02:00
Ben Noordhuis
96f32a206b test: replace sprintf() with snprintf()
There is zero risk of overflowing the buffer, it's just a good habit.
2013-08-05 01:16:34 +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
c82cea1ec5 build: enable AM_INIT_AUTOMAKE([subdir-objects])
Squelches (justified) warnings with automake 1.14.

Object files are built in subdirectories now so fix up the dtrace
postprocessing step to scan for *.lo files in said subdirectories.

Fixes #866.
2013-07-29 00:36:49 +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
Timothy J Fontaine
b13941cf17 build: dtrace shouldn't break out of tree builds
Fixes #848.
2013-07-25 12:12:48 +02:00
Ben Noordhuis
4ce3a312aa test: fix signed/unsigned comparison warnings 2013-07-25 11:25:53 +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
Timothy J Fontaine
2f3124a8c1 build: add DTrace detection for autotools 2013-07-03 16:04:01 -07:00
Ben Noordhuis
3b9cfe2261 build: use AM_SILENT_RULES conditionally
It's not supported by older automake versions.
2013-07-02 18:01:28 +02:00
Ben Noordhuis
5a3b8f9fce test: fix spawn_setgid_fails and spawn_setuid_fails
Don't try to set a bogus UID or GID and expect to get a meaningful
error. The test expected EPERM but SunOS returns EINVAL because the
id is outside of the range of valid user/group ids.

Try to switch to UID/GID 0. Give up privileges first if we're root,
else the setuid/setgid system call will succeed when it's expected
to fail.
2013-07-02 16:32:42 +02:00
Ben Noordhuis
d0be852cb1 test: fix fs_chown when running as root
chown(2) to root is expected to fail - unless you're root, of course.
2013-07-02 13:39:28 +02:00
Ben Noordhuis
d4f6165346 test: fix fs_fstat test on sunos
The tests are no longer compiled with -D_XOPEN_SOURCE=500 when building
with autotools. Tell the test explicitly that SunOS systems are
expected to have nanosecond fstat(2) granularity.
2013-07-02 13:34:19 +02:00
Ben Noordhuis
d2f67b92c6 build: use AM_PROG_AR conditionally
AM_PROG_AR does not exist in automake v0.11 but without it, you can't
build libuv with automake v0.12+ on Darwin.
2013-07-02 12:42:29 +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
Navaneeth Kedaram Nambiathan
624be53e02 build: add install target to the makefile
Before this commit, there was no way to install libuv other than
manually copying required files to the path. This commit introduces
an install target which installs the libuv.a, libuv.so and header files
to the install prefix.

    ``
    make
    make install
    ``

The above will use the default prefix `/usr/local`

    ``
    make
    make install PREFIX=/usr
    ``

The above will install to `/usr`
2013-06-30 02:02:05 +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
isaacs
652d5c9e45 Now working on v0.11.6 2013-06-26 10:19:42 -07:00
isaacs
e3c63ff162 2013.06.27, Version 0.11.5 (Unstable)
Changes since version 0.11.4:

* build: remove CSTDFLAG, use only CFLAGS (Ben Noordhuis)

* unix: support for android builds (Linus Mårtensson)

* unix: avoid extra read, short-circuit on POLLHUP (Ben Noordhuis)

* uv: support android libuv standalone build (Linus Mårtensson)

* src: make queue.h c++ compatible (Ben Noordhuis)

* unix: s/ngx-queue.h/queue.h/ in checksparse.sh (Ben Noordhuis)

* unix: unconditionally stop handle on close (Ben Noordhuis)

* freebsd: don't enable dtrace if it's not available (Brian White)

* build: make HAVE_DTRACE=0 should disable dtrace (Timothy J. Fontaine)

* unix: remove overzealous assert (Ben Noordhuis)

* unix: remove unused function uv_fatal_error() (Ben Noordhuis)

* unix, windows: clean up uv_thread_create() (Ben Noordhuis)

* queue: fix pointer truncation on LLP64 platforms (Bert Belder)

* build: set OS=="android" for android builds (Linus Mårtensson)

* windows: don't use uppercase in include filename (Ben Noordhuis)

* stream: add an API to make streams do blocking writes (Henry Rawas)

* windows: use WSAGetLastError(), not errno (Ben Noordhuis)
2013-06-26 10:19:40 -07:00
Ben Noordhuis
88a2c7ff20 build: all now builds static and dynamic lib
The `make all` target now builds both libuv.a and libuv.{so,dylib}
rather than just libuv.a.
2013-06-26 10:32:18 +02:00
Ben Noordhuis
5841852703 test: add 'start timer from check handle' test
Check that a timer that is started from a check handle gets picked up
correctly, i.e. that it influences the timeout used in the next tick
of the event loop.
2013-06-26 13:56:32 +02:00
Ben Noordhuis
488b43ecc5 test: fix signed/unsigned compiler warning 2013-06-26 13:40:40 +02:00
Ben Noordhuis
a0bc4cca74 build: darwin: disable -fstrict-aliasing warnings
gcc 4.2.1 as shipped with Xcode complains incessantly about aliasing
warnings, which, while technically true, disregards the fact that the
aliased types have the same layout in memory. Squelch the warnings.
2013-06-26 13:13:53 +02:00
Ben Noordhuis
c8c775bd97 windows: use WSAGetLastError(), not errno
setsockopt() doesn't touch errno on failure. Use WSAGetLastError()
instead.

This is a back-port of commit 30a8b44 from the master branch.
2013-06-26 01:09:18 +02:00
Ben Noordhuis
30a8b44c4c windows: use WSAGetLastError(), not errno
setsockopt() doesn't touch errno on failure. Use WSAGetLastError()
instead.
2013-06-26 01:03:38 +02:00