Commit Graph

2333 Commits

Author SHA1 Message Date
Brian White
c021ee0795 unix, windows: remove unused variables 2013-07-25 11:25:43 +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
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
Henry Rawas
92040eb712 stream: add an API to make streams do blocking writes
This patch adds the `uv_stream_set_blocking` API which makes all
uv_write calls to that stream blocking. It currently only works for
pipes, on windows.
2013-06-20 19:27:39 +02:00
Bert Belder
495d1a09fb windows: uv_spawn shouldn't reject reparse points
This fixes an issue where uv_spawn would not try to run a reparse point,
and continue to scan the PATH instead. Effectively, it was impossible to
spawn a symlinked binary. This commit fixes that.

Also see #748
2013-06-19 00:15:20 +02:00
Ben Noordhuis
6607e70253 test: open stdout fd in write-only mode
Fixes #771.
2013-06-18 23:53:03 +02:00
Ben Noordhuis
b1d390eb79 windows: don't use uppercase in include filename
Change <Winsock2.h> to <winsock2.h>. The former breaks
cross-compilation with mingw.
2013-06-14 00:45:03 +02:00
Linus Mårtensson
ff3ee84442 build: set OS=="android" for android builds
Work around the build name issues by instead manually adding the build
target for android builds using '-DOS=android'

This additionally resolves problems caused by the OS variable being
rewritten from "android" to "linux" in gyp. This causes errors, as
real-time support (-lrt) and pthread support (-lpthread) is not
available in the android NDK toolchain as libraries.

The functions present in these libraries are included automatically
during the build instead during the android compilation process.
2013-06-13 21:04:03 +02:00
Bert Belder
7d8504cf69 queue: fix pointer truncation on LLP64 platforms
QUEUE_DATA used to cast a pointer to long and back to pointer. This can
corrupt pointers on systems where the long type isn't large enough to
store pointer, like Windows x64. This commit fixes that.

Fixes #835
2013-06-15 14:08:36 +02:00
Ben Noordhuis
7e8d0e6d9c Merge remote-tracking branch 'origin/v0.10' 2013-06-13 09:05:12 +02:00
Andrei Sedoi
5096f1e096 linux: add support for MIPS 2013-06-13 09:04:15 +02:00
Ben Noordhuis
0c3b061aac Merge remote-tracking branch 'origin/v0.10'
Conflicts:
	src/unix/stream.c
	src/version.c
2013-06-13 02:28:44 +02:00
Ben Noordhuis
72e440d7e1 Now working on v0.10.12 2013-06-12 21:52:05 +02:00
Ben Noordhuis
c3b75406a6 2013.06.13, Version 0.10.11 (Stable)
Changes since version 0.10.10:

* 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: clear UV_STREAM_SHUTTING after shutdown() (Ben Noordhuis)

* unix: fix busy loop, write if POLLERR or POLLHUP (Ben Noordhuis)
2013-06-12 21:52:01 +02:00
Ben Noordhuis
12210fe578 unix: fix busy loop, write if POLLERR or POLLHUP
This fixes a busy loop by working around a quirk with Linux kernels
<= 2.6.32 where an EPIPE or ECONNRESET error on a file descriptor that
is polled for EPOLLOUT but not EPOLLIN gets reported by epoll_wait() as
just EPOLLERR|EPOLLHUP, like this:

  epoll_wait(5, {{EPOLLERR|EPOLLHUP, {u32=12, u64=12}}}, 1024, 433) = 1

Before this commit, libuv called uv__read() which attempts to read from
the file descriptor.  With newer kernels and on other operating systems
that fails like this:

  read(12, "", 65536)         = -1 EPIPE (Broken pipe)

Which tells libuv there is a connection error and it should notify the
user of that.  On the affected Linux kernels however, the read succeeds
with an EOF:

  read(12, "", 65536)         = 0

Which is subsequently passed on to the user. In most cases, the user
will close the handle and everything is fine.

Node.js however sometimes keeps the handle open in an attempt to flush
pending write requests.  While libuv doesn't officially support this,
unofficially it works...

...except on those older kernels.  Because the kernel keeps waking up
the event loop without setting POLLOUT and because the read calls EOF
but don't error, libuv's I/O state machine doesn't progress.

That's why this commit changes uv__stream_io() to also write pending
data.  While the read() system call doesn't error, the write() system
call will.

Fixes joyent/node#5504.
2013-06-08 04:09:42 +02:00
Ben Noordhuis
536c5f8661 unix: clear UV_STREAM_SHUTTING after shutdown()
Fix a state machine buglet where the UV_STREAM_SHUTTING flag didn't get
cleared.
2013-06-08 03:14:33 +02:00
Ben Noordhuis
3ab354367b unix: remove overzealous assert
Several node.js users are hitting this assert under what appear to be
mostly benign conditions. In other words, it's unclear whether it's
catching real bugs or just has wrong expectations.

An aborting process is rather disruptive so I'm removing the assert
from the stable branch and relanding it in the master branch.
2013-06-07 11:28:32 +02:00
Timothy J Fontaine
f84becc64e build: make HAVE_DTRACE=0 should disable dtrace 2013-06-06 20:32:52 +02:00
Ben Noordhuis
897463326b unix, windows: clean up uv_thread_create()
Make uv_thread_create() and its helper function a little more DRY and
a little less impenetrable.
2013-06-06 11:27:07 +02:00
Ben Noordhuis
43205ed553 unix: remove unused function uv_fatal_error() 2013-06-06 08:54:36 +02:00
Ben Noordhuis
c16ed503b0 Merge remote-tracking branch 'origin/v0.10'
Conflicts:
	AUTHORS
	ChangeLog
	src/unix/stream.c
	src/version.c
2013-06-07 11:41:41 +02:00
Brian White
c8ffee3460 freebsd: don't enable dtrace if it's not available 2013-06-05 22:50:08 +02:00
Ben Noordhuis
8e4b248ca6 unix: unconditionally stop handle on close
Make sure the handle is fully stopped by the time uv__stream_close()
calls uv_read_stop(). Fixes the following assertion:

    Assertion failed: (!uv__io_active(&stream->io_watcher, UV__POLLOUT)
    || !ngx_queue_empty(&stream->write_completed_queue)
    || !ngx_queue_empty(&stream->write_queue)
    || stream->shutdown_req != NULL
    || stream->connect_req != NULL), function uv_read_stop,
    file ../deps/uv/src/unix/stream.c, line 1329.

Fixes joyent/node#5622.
2013-06-05 15:17:01 +02:00
isaacs
e9ae62d13a Now working on v0.10.11 2013-06-04 12:00:31 -07:00
isaacs
0d95a88bd3 2013.06.05, Version 0.10.10 (Stable)
Changes since version 0.10.9:

* include: document uv_update_time() and uv_now() (Ben Noordhuis)

* linux: fix cpu model parsing on newer arm kernels (Ben Noordhuis)

* linux: fix memory leak in uv_cpu_info() error path (Ben Noordhuis)

* linux: don't ignore OOM errors in uv_cpu_info() (Ben Noordhuis)

* unix, windows: move uv_now() to uv-common.c (Ben Noordhuis)

* darwin: make uv_fs_sendfile() respect length param (Wynn Wilkes)
2013-06-04 12:00:29 -07:00
Ben Noordhuis
5b1422ba2b unix: s/ngx-queue.h/queue.h/ in checksparse.sh 2013-06-04 12:25:19 +02:00
Ben Noordhuis
c766dfe815 src: make queue.h c++ compatible
Squelch a warning about a cast from void* to another pointer type.
It's legal C but not legal C++. Makes queue.h usable in node.js.
2013-06-04 12:20:40 +02:00
Ben Noordhuis
eb1f60c022 build: fix build breakage from 3fdd2a1
Make sure the android_build variable is defined.
2013-05-31 17:18:22 +02:00