Commit Graph

2488 Commits

Author SHA1 Message Date
Luca Bruno
6462eaf4dc test: relax TTY availability assumptions
test-tty.c currently assumes that a TTY is available to the test runner,
and fails hard if not. This may not be true on some autobuilding
environment, making the build fail as shown in [0].
Instead, let's properly skip the test in such cases.

[0] http://ur1.ca/fr5bd

Signed-off-by: Luca Bruno <lucab@debian.org>
2013-10-08 16:26:04 +02:00
Fedor Indutny
429bb804ed fsevents: fix clever rescheduling
There're could be a situation, where one fsevents handle gets created
and another one is destroyed simultaneously. In such cases
`fsevent_need_reschedule` will be set to 1 twice and reset only once,
leaving handle destructor hanging in uv_sem_wait().
2013-10-05 22:18:06 +04:00
Ben Noordhuis
0d435a5662 unix: remove uv__pipe_accept()
It's basically a less advanced version of uv__server_io().  Drop the
former in favor of the latter.
2013-10-01 04:14:36 +02:00
Ben Noordhuis
359d667893 unix: sanity-check fds before closing
Ensure that close() system calls don't close stdio file descriptors
because that is almost never the intention.

This is also a partial workaround for a kernel bug that seems to affect
all Linux kernels when stdin is a pipe that gets closed: fd 0 keeps
signalling EPOLLHUP but a subsequent call to epoll_ctl(EPOLL_CTL_DEL)
fails with EBADF.  See joyent/node#6271 for details and a test case.
2013-10-01 03:55:54 +02:00
Ben Noordhuis
636f2056a7 Merge remote-tracking branch 'origin/v0.10'
Conflicts:
	ChangeLog
	include/uv-darwin.h
	src/unix/darwin.c
	src/unix/fsevents.c
	src/version.c
	src/win/fs.c
2013-10-01 13:20:21 +02:00
Ben Noordhuis
8c9cbee1b1 Revert "unix: set O_NONBLOCK in uv_pipe_open()"
It turns out that node.js relies on the blocking behavior of pipes in
some cases, notably when forking worker processes.  Reopens #941.

This reverts commit 8fe4ca686b.
2013-09-28 20:50:45 +02:00
Ben Noordhuis
8fe4ca686b unix: set O_NONBLOCK in uv_pipe_open()
Don't rely on the caller to set the O_NONBLOCK flag on the file
descriptor.

Prevents sporadic stalls when the file descriptor is in blocking mode
and exactly as many bytes are read as there are available; in that case,
libuv will try to read again and block.  Node.js was guilty of this.

Fixes #941.
2013-09-28 10:30:09 +02:00
Ben Noordhuis
7c7717c6b2 windows: remove duplicate check in stream.c
Fixes #937.
2013-09-25 23:07:10 +02:00
Timothy J Fontaine
e9df7cbcbb Now working on v0.10.18 2013-09-24 13:40:44 -07:00
Timothy J Fontaine
9670e0a935 2013.09.25, Version 0.10.17 (Stable)
Changes since version 0.10.16:

* build: remove GCC_WARN_ABOUT_MISSING_NEWLINE (Ben Noordhuis)

* darwin: fix 10.6 build error in fsevents.c (Ben Noordhuis)
2013-09-24 13:40:40 -07:00
Bert Belder
581e8c9266 doc: update readme
Update the intro blurb and spend a few more words on libuv's features.
2013-09-23 11:38:03 +02:00
Timothy J Fontaine
717e0e5635 build: use -pthread on sunos
When building on sunos with autoconf make sure to specify -pthread
otherwise there will be race conditions with errno and etc
2013-09-20 10:50:19 -07:00
Ben Noordhuis
b460142451 bench: measure total/init/dispatch/cleanup times
* Add finer-grained measurements to the million_timers benchmark.
  Before this commit it only measured the total running time.

* Bump the number of inserted timers from 1M to 10M.  With one million
  timers, it finishes too quickly to get useful profiling data out of
  it with perf or oprofile.  The name of the benchmark is now a lie but
  such is life.
2013-09-13 00:17:52 +02:00
Ben Noordhuis
d7115f0677 unix, windows: make uv_is_*() always return 0 or 1
Ensure that the following API functions always return either 0 or 1:

  * uv_is_active()
  * uv_is_closing()
  * uv_is_readable()
  * uv_is_writable()
2013-09-12 13:30:06 +02:00
Ben Noordhuis
05822a5507 unix: wrap long lines at 80 columns 2013-09-11 17:29:43 +02:00
Ben Noordhuis
f5baf210df test: wrap long lines at 80 columns 2013-09-11 17:29:43 +02:00
Ben Noordhuis
ce3c38a5d8 include: make uv_process_options_t.cwd const
There is no reason for it to be non-const, libuv treats it as a
read-only input.  Make it a pointer to a const string.
2013-09-10 23:29:35 +02:00
Ben Noordhuis
adcc2273f4 include: update uv_is_active() documentation
Seems to have been overlooked in the reference counting refactor back
in May 2012 in commit 9efa8b3.  Clarify what "active" means for
different kinds of handles.
2013-09-08 23:25:31 +02:00
Ben Noordhuis
b83109c524 include: fix typo in comment in uv.h 2013-09-08 23:25:07 +02:00
Ben Noordhuis
9e4982f5c9 include: remove UV_IO_PRIVATE_FIELDS macro
It's an alias for UV_IO_PRIVATE_PLATFORM_FIELDS.  Remove the macro and
use UV_IO_PRIVATE_PLATFORM_FIELDS directly.
2013-09-08 20:21:24 +02:00
Ben Noordhuis
b7d333fc91 include: clean up includes in uv.h
* size_t is defined in <stddef.h>, not <sys/types.h>

* Simplify the platform check.
2013-09-08 20:14:30 +02:00
Ben Noordhuis
02e8c8ef65 include: clarify uv_tcp_bind() behavior
On BSD-like platforms, EADDRINUSE is returned by the bind() system call.
On other platforms, it's returned by the listen() system call.

In other words, some platforms are 'first to bind wins', others are
'first to listen wins' - but only with TCP sockets: UNIX domain sockets
always return EADDRINUSE from the bind() system call, UDP sockets don't
call listen() in the first place.

Fixes #769.
2013-09-06 15:15:36 +02:00
Saúl Ibarra Corretgé
2b9c374c1c windows: run close callbacks after polling for i/o
Makes the uv-win behavior compatible with uv-unix.

Fixes #796.
2013-09-06 06:28:42 +02:00
Ben Noordhuis
983fa68e9f darwin: fix 10.6 build error in fsevents.c
Work around an 'initializer element is not constant' build error in
src/unix/fsevents.c by turning the const int flags into #defines.

Only an issue on OS X 10.6 due to the old compiler it uses.

Fixes #908.

This is a back-port of commit 82f2472 from the master branch.
2013-09-05 21:33:59 +02:00
Ben Noordhuis
712835a673 build: remove GCC_WARN_ABOUT_MISSING_NEWLINE
Not compatible with non-Apple gcc builds.  Fixes the following build
error:

    gcc-4.8: error: unrecognized command line option '-Wnewline-eof'
2013-09-05 21:33:59 +02:00
Brian Kaisner
8e23b046a6 build: clarify instructions for Windows
Clarified up front that Python must be installed for all Windows builds
and it must be in the path. Simplified the Windows instructions by
removing the redundant msbuild guidance.

Also added subheadings for each unique build environment.
2013-09-05 21:17:58 +02:00
Bert Belder
7e5c63c88d Now working on v0.10.17 2013-09-05 16:45:51 +02:00
Bert Belder
2bce230d81 2013.09.06, Version 0.10.16 (Stable)
Changes since version 0.10.15:

* windows: make uv_shutdown() for write-only pipes work (Bert Belder)

* windows: make uv_fs_open() report EINVAL when invalid arguments are
  passed (Bert Belder)

* windows: make uv_fs_open() report _open_osfhandle() failure correctly
  (Bert Belder)

* windows: make uv_fs_chmod() report errors correctly (Bert Belder)

* windows: wrap multi-statement macros in do..while block (Bert Belder)
2013-09-05 16:45:45 +02:00
Bert Belder
20e774c62a windows/fs: handle _open_osfhandle() failure correctly
Until now we assumed that _open_osfhandle() would set _doserrno on
failure. This assumption was very wrong in one obvious case, namely when
the CRT file descriptor table would fill up. In that case errno is set
to EMFILE, but GetLastError() returns zero - which makes sense because
it's not a win32 error but rather a CRT problem.
2013-09-05 09:05:28 +02:00
Bert Belder
489fb4c972 windows/fs: make uv_fs_open() report EINVAL correctly
Before, when the user passed an invalid paramter to uv_fs_open, libuv
would detect this and call SET_REQ_RESULT to set the result value to -1.
SET_REQ_RESULT then stored whatever error code was returned by
GetLastError(), which would have no relationship to the actual problem,
and might as well be zero.
2013-09-05 09:05:28 +02:00
Bert Belder
0f3c910c1b windows/fs: wrap multi-statement macros in do..while block 2013-09-05 09:05:27 +02:00
Bert Belder
faf2c5932c windows/fs: handle _open_osfhandle() failure correctly
Until now we assumed that _open_osfhandle() would set _doserrno on
failure. This assumption was very wrong in one obvious case, namely when
the CRT file descriptor table would fill up. In that case errno is set
to EMFILE, but GetLastError() returns zero - which makes sense because
it's not a win32 error but rather a CRT problem.
2013-09-05 08:52:14 +02:00
Bert Belder
812717d0dd windows/fs: make uv_fs_open() report EINVAL correctly
Before, when the user passed an invalid paramter to uv_fs_open, libuv
would detect this and call SET_REQ_RESULT to set the result value to -1.
SET_REQ_RESULT then stored whatever error code was returned by
GetLastError(), which would have no relationship to the actual problem,
and might as well be zero.
2013-09-05 08:52:11 +02:00
Bert Belder
39bef32906 windows/fs: wrap multi-statement macros in do..while block 2013-09-05 08:52:03 +02:00
Ben Noordhuis
5dad19503d Now working on v0.11.14 2013-09-04 14:45:22 +02:00
Ben Noordhuis
f5b6db6c1d 2013.09.05, Version 0.11.13 (Unstable)
Changes since version 0.11.12:

* unix: define _GNU_SOURCE, exposes glibc-isms (Ben Noordhuis)

* windows: check for nonconforming swprintf arguments (Brent Cook)

* build: include internal headers in source list (Brent Cook)

* include: merge uv_tcp_bind and uv_tcp_bind6 (Ben Noordhuis)

* include: merge uv_tcp_connect and uv_tcp_connect6 (Ben Noordhuis)

* include: merge uv_udp_bind and uv_udp_bind6 (Ben Noordhuis)

* include: merge uv_udp_send and uv_udp_send6 (Ben Noordhuis)
2013-09-04 14:45:18 +02:00
Ben Noordhuis
08c6ddeefb include: merge uv_udp_send and uv_udp_send6
Merge uv_udp_send6() into uv_udp_send().  uv_udp_send() now takes a
const struct sockaddr*.
2013-09-04 03:17:29 +02:00
Ben Noordhuis
bcee403ed2 include: merge uv_udp_bind and uv_udp_bind6
Merge uv_udp_bind6() into uv_udp_bind().  uv_udp_bind() now takes a
const struct sockaddr*.
2013-09-04 03:17:04 +02:00
Ben Noordhuis
5c675c4a4e include: merge uv_tcp_connect and uv_tcp_connect6
Merge uv_tcp_connect6() into uv_tcp_connect().  uv_tcp_connect() now
takes a const struct sockaddr*.
2013-09-04 03:16:36 +02:00
Ben Noordhuis
5fceccc535 include: merge uv_tcp_bind and uv_tcp_bind6
Merge uv_tcp_bind6() into uv_tcp_bind().  uv_tcp_bind() now takes a
const struct sockaddr*.
2013-09-04 03:15:30 +02:00
Brent Cook
c363cd0dba build: include internal headers in source list
Allows 'make dist-*' targets to generate working tarballs.
2013-09-04 01:09:42 +02:00
Brent Cook
fe3a11e09f windows: check for nonconforming swprintf arguments
Newer versions of mingw do include the correct API for swprintf.
Check for _CRT_NON_CONFORMING_SWPRINTFS as specified in the swprintf
documentation:
http://msdn.microsoft.com/en-us/library/ybk95axf(v=vs.90).aspx
2013-09-04 01:09:23 +02:00
Ben Noordhuis
f3f23b2d05 unix: define _GNU_SOURCE, exposes glibc-isms
EAI_NODATA and some other getaddrinfo() error codes are returned by
glibc but not exposed in the headers unless _GNU_SOURCE is defined.

Only define in src/uv-common.c because that's the only file that deals
with EAI_* error codes.
2013-09-01 13:50:50 +02:00
Ben Noordhuis
3e054c3629 Now working on v0.11.13 2013-09-03 00:37:15 +02:00
Ben Noordhuis
82d01d5f67 2013.09.03, Version 0.11.12 (Unstable)
Changes since version 0.11.11:

* test: fix epoll_wait() usage in test-embed.c (Ben Noordhuis)

* include: uv_alloc_cb now takes uv_buf_t* (Ben Noordhuis)

* include: uv_read{2}_cb now takes const uv_buf_t* (Ben Noordhuis)

* include: uv_ip[46]_addr now takes sockaddr_in* (Ben Noordhuis)

* include: uv_tcp_bind{6} now takes sockaddr_in* (Ben Noordhuis)

* include: uv_tcp_connect{6} now takes sockaddr_in* (Ben Noordhuis)

* include: uv_udp_recv_cb now takes const uv_buf_t* (Ben Noordhuis)

* include: uv_udp_bind{6} now takes sockaddr_in* (Ben Noordhuis)

* include: uv_udp_send{6} now takes sockaddr_in* (Ben Noordhuis)

* include: uv_spawn takes const uv_process_options_t* (Ben Noordhuis)

* include: make uv_write{2} const correct (Ben Noordhuis)

* windows: fix flags assignment in uv_fs_readdir() (Ben Noordhuis)

* windows: fix stray comments (Ben Noordhuis)

* windows: remove unused is_path_dir() function (Ben Noordhuis)
2013-09-03 00:37:10 +02:00
Ben Noordhuis
76709c6b33 windows: remove unused is_path_dir() function 2013-09-01 08:25:26 +02:00
Ben Noordhuis
585b6b7d1f windows: remove unused variable in tty.c 2013-09-01 08:25:26 +02:00
Ben Noordhuis
d8ab41bee3 windows: fix stray comments 2013-09-01 08:25:25 +02:00
Ben Noordhuis
bdc828972a windows: fix flags assignment in uv_fs_readdir() 2013-09-01 08:25:25 +02:00
Ben Noordhuis
779b8d81e9 include: make uv_write{2} const correct 2013-09-01 08:25:25 +02:00