Commit Graph

2147 Commits

Author SHA1 Message Date
Ben Noordhuis
fe136cedb9 build: disable -Wstrict-aliasing on darwin
The antiquated gcc/clang that ships with Xcode emits waaaay too many
false positives.
2013-03-28 00:10:51 +01:00
Ben Noordhuis
0fb9b22ce6 build: simplify .buildstamp rule 2013-03-26 15:16:24 +01:00
Ben Noordhuis
bd20b37170 doc: update README, s/OS/PLATFORM/
Commit a9740c9 changed the name of the OS var to PLATFORM but forgot to
update the README.
2013-03-26 14:50:21 +01:00
Ben Noordhuis
3f6122b3f7 include: remove extraneous const from uv_version()
Fixes the following warning:

  include/uv.h:236:30: warning: type qualifiers ignored on function
  return type [-Wignored-qualifiers]
   UV_EXTERN const unsigned int uv_version(void);
2013-03-26 14:48:30 +01:00
Bert Belder
d5f8c1a4d3 Now working on v0.10.3 2013-03-25 15:41:25 +01:00
Bert Belder
0f36a00568 2013.03.25, Version 0.10.2 (Stable)
This is the first officially versioned release of libuv. Starting now
libuv will make releases independently of Node.js.

Changes since Node.js v0.10.0:

* test: add tap output for windows (Timothy J. Fontaine)

* unix: fix uv_tcp_simultaneous_accepts() logic (Ben Noordhuis)

* include: bump UV_VERSION_MINOR (Ben Noordhuis)

* unix: improve uv_guess_handle() implementation (Ben Noordhuis)

* stream: run try_select only for pipes and ttys (Fedor Indutny)

Changes since Node.js v0.10.1:

* build: rename OS to PLATFORM (Ben Noordhuis)

* unix: make uv_timer_init() initialize repeat (Brian Mazza)

* unix: make timers handle large timeouts (Ben Noordhuis)

* build: add OBJC makefile var (Ben Noordhuis)

* Add `uv_version()` and `uv_version_string()` APIs (Bert Belder)
2013-03-25 15:40:53 +01:00
Bert Belder
eeeb07934b Update AUTHORS and .mailmap 2013-03-25 15:36:20 +01:00
Bert Belder
c7b1c53ef1 Prepare for making releases, add uv_version/uv_version_string API 2013-03-25 15:35:00 +01:00
Ben Noordhuis
1487d5aea7 build: add OBJC makefile var
Overrides the Objective-C compiler that is used. Defaults to $(CC).
2013-03-23 23:16:54 +01:00
Ben Noordhuis
9b619396d9 unix: make timers handle large timeouts
This commit fixes two closely related integer overflow bugs:

* Timers with a timeout > INT_MAX cause uv__next_timeout() to return
  a negative value.

* Timers with very large timeouts (close or equal to ULLONG_MAX) run on
  the next tick.

In both cases, clamp the values to prevent the overflow from happening.

Fixes joyent/node#5101.
2013-03-21 14:54:36 +01:00
Brian Mazza
77cb29a723 unix: make uv_timer_init() initialize repeat
uv_timer_get_repeat() should return 0 for timers that haven't been
started.
2013-03-19 23:15:30 +01:00
Ben Noordhuis
a9740c9bc4 build: rename OS to PLATFORM
Rename the OS make variable to PLATFORM, it conflicts with the OS env
var. That is, running `make` when the OS env var is set, may cause
spurious build breakage.

Fixes #737.
2013-03-17 00:12:43 +01:00
Fedor Indutny
b45a74fab3 stream: run try_select only for pipes and ttys
Its not necesary for TCP and other streams, since fd is always working
with kqueue there.
2013-03-16 23:29:24 +01:00
Ben Noordhuis
7b66ea18ff unix: improve uv_guess_handle() implementation
Make it understand FIFOs, character devices and sockets.
2013-03-14 14:22:04 +01:00
Ben Noordhuis
9f714a1d25 include: bump UV_VERSION_MINOR
Fixes #740.
2013-03-14 12:49:21 +01:00
Ben Noordhuis
905d56c140 unix: fix uv_tcp_simultaneous_accepts() logic
Inverts the meaning of the 'enable' argument. Before, it actually set
the UV_TCP_SINGLE_ACCEPT flag when enable=1. Now it clears it, which is
what uv-win does and what you would expect it to do.
2013-03-12 12:39:37 +01:00
Timothy J Fontaine
2f84a57566 test: add tap output for windows 2013-03-11 18:12:25 +01:00
Bert Belder
5462dab889 win/tcp: don't enable iocp sync bypass when iocp emulation is used
When iocp sync bypass is in use libuv doesn't expect the system to
generate events when an i/o operation completes synchronously. However
when iocp emulation is enabled an event will always be generated because
SetFileCompletionNotificationModes() doesn't stop OVERLAPPED.hEvent from
becoming signaled.

This should fix joyent/node#4959.
2013-03-09 20:22:50 +01:00
Bert Belder
f59dc221e6 win: fix potential HANDLE corruption due to incorrect cast
Closes #738.
2013-03-09 18:24:59 +01:00
isaacs
b68ee40496 win: Map ERROR_INVALID_FUNCTION to EISDIR
This error is raised when calling read() or write() on a directory.

A bit of googling turns up some cases where this error can be raised
that are not properly mapped to EISDIR, but are also cases that libuv
doesn't really care about, like the Password Manager API,
GetFirmwareEnvironmentVariable, or CreateTapePartition.

If libuv ever needs to handle these cases, then I suppose that the
ERROR_INVALID_FUNCTION->EISDIR mapping could be done directly in the
fs read() and write() functions, but doing so at this point seems
premature, as it makes the error code mapping a bit more messy.

Fixes joyent/node#4951
2013-03-07 16:00:50 -08:00
Ben Noordhuis
8fbe43379d unix: please valgrind, free memory in threadpool.c 2013-03-07 01:57:30 +01:00
Ben Noordhuis
dac5a758f8 unix: replace volatile cast with ACCESS_ONCE macro 2013-03-07 00:53:07 +01:00
Ben Noordhuis
e0df7b6873 unix: fix strict aliasing warning in udp.c 2013-03-07 00:53:06 +01:00
Ben Noordhuis
b6a50c7295 unix: add uv_buf_t static asserts to core.c
Verify that our uv_buf_t type is ABI-compatible with struct iovec.
2013-03-07 00:53:06 +01:00
Ben Noordhuis
ef9b065532 unix: add STATIC_ASSERT macro 2013-03-07 00:52:50 +01:00
Ben Noordhuis
ee9899e28b unix: fix strict aliasing warnings, macro-ify functions
Replace a few internal functions in uv-common.h with macros to avoid
strict aliasing warnings with older versions of gcc.

It's not smart enough to figure out that e.g. a uv_tcp_t is an instance
of uv_handle_t with similar alignment requirements and therefore no
aliasing happens. More recent versions of gcc don't suffer from this.

I'm not normally in the habit of catering to compiler defects but the
aliasing warnings drown out legitimate warnings, hence the change.
2013-03-06 23:47:43 +01:00
Ben Noordhuis
1e97b4567e unix: honor UV_THREADPOOL_SIZE environment var
Make the size of the thread pool configurable through an environment
variable. For sanity reasons, the size is clamped to the range 1-128.
2013-03-06 23:19:34 +01:00
Bert Belder
f89125e0e6 win/tty: fix typo in color attributes enumeration 2013-03-05 20:31:52 +01:00
Bert Belder
4abad2381e win/tty: don't touch insert mode or quick edit mode
Hopefully this fixes joyent/node#4809.
2013-03-05 20:05:58 +01:00
Bert Belder
8a99762c0e win/tty: fix case where uv_read_start incorrectly reports failure
In very rare circumstances a uv_read_start() call on a uv_tty_t handle
in raw mode would return -1 but there was no actual failure. This patch
fixes that.
2013-03-05 20:05:57 +01:00
Ben Noordhuis
0b26af376a unix: handle POLLERR and POLLHUP in uv__stream_io
Fixes a busy loop when the file descriptor emits POLLHUP but not POLLIN
or POLLOUT, e.g. when polling the read end of a pipe and the write end
is closed.

Fixes joyent/node#4923.
2013-03-05 16:04:31 +01:00
Bert Belder
ea0796f3bf windows: link with advapi32 and shell32 libraries
Older versions of GYP would set up the Visual Studio project to link
with these libraries by default, but this was changed in r1584 (see
https://codereview.chromium.org/12256017).

Closes #728
2013-03-04 20:22:25 +01:00
Ben Noordhuis
7e59f9bb53 linux: make uv_cpu_info() handle absent procfs
Return an error when reading from /proc files fails because the procfs
isn't mounted.
2013-03-02 01:48:44 +01:00
Ben Noordhuis
2a8d2a5b73 darwin: fix spurious uv_write2() segfault
We abuse uv_write2() to send over UDP handles to child processes.
Don't call uv__stream_fd() on those handles, it's a macro that on OS X
evaluates to a function that operates on a uv_stream_t with a couple of
OS X specific fields. On other Unices it does (handle)->io_watcher.fd,
which works but only by accident.

Fixes joyent/node#4870.
2013-03-01 01:58:27 +01:00
Marc Schlaich
0ad46bdb56 build, windows: return an error code on failure 2013-02-28 16:18:54 +01:00
Timothy J Fontaine
49d2ae33ef test: fix tap output even when ok but have output 2013-02-27 22:48:54 +01:00
Ben Noordhuis
1821bba408 test: fix tap output check
Only report as an error when status != 0.

Stops the platform_output test from being reported as having failed
on Jenkins.
2013-02-27 22:20:14 +01:00
Ben Noordhuis
cdf69dbed6 build: add distclean target to out-of-tree builds 2013-02-27 22:09:11 +01:00
Ben Noordhuis
dd20025207 build: make clean target remove all build artifacts 2013-02-27 22:09:11 +01:00
Ben Noordhuis
78dcaa5cac darwin: fix read from uninitialized struct kevent
In the OS X fallback code, don't read from the struct when the kevent()
syscall times out.
2013-02-27 21:48:37 +01:00
Ben Noordhuis
7c3b9e5a12 unix: make stream.c internal functions static 2013-02-27 21:40:21 +01:00
Ben Noordhuis
a924f79023 test: remove 'is root?' check
I debug tests regularly as root (because dtrace and dtruss require the
additional privileges). The 'is root?' check gets in the way more often
than it prevents me from doing something silly. Remove it.
2013-02-27 21:35:40 +01:00
Marc Schlaich
85124d7eb5 build, windows: allow override of python executable
Fixes #723.
2013-02-27 19:26:47 +01:00
Ben Noordhuis
a0c1d84c14 linux, darwin: don't touch environ in uv_setup_args
Don't overwrite the environment. On OS X, the entries in the environ
table are not necessarily adjacent. It's arguably also safer for setuid
binaries.

Fixes joyent/node#4847.
2013-02-26 20:28:47 +01:00
Andrius Bentkus
c5101ae9b5 unix, windows: add common uv_udp_* error checking 2013-02-26 16:57:20 +01:00
Saúl Ibarra Corretgé
ae2b30a48f windows: initialize stop_flag explicitly
The default loop lives in the bss section so it's zeroed on startup
but loops created with uv_loop_new() live on the heap and contain
random garbage. Initialize the stop_flag explicitly to avoid spurious
bugs.
2013-02-26 15:26:27 +01:00
Timothy J Fontaine
72bbf5d702 test: don't rewind_cursor when using tap_output 2013-02-25 19:00:16 +01:00
Saúl Ibarra Corretgé
4b957482ba windows: fix uv_stop in ONCE and NOWAIT modes
Same as the fix in 492efb9 but this time for uv-win.
2013-02-25 18:26:58 +01:00
Ben Noordhuis
492efb95ff unix: make uv_stop work when embedded
* Make uv_stop() work when libuv is embedded in another event loop.

* Fix a small bug where loop->stop_flag was not reset when mode ==
  UV_RUN_ONCE or UV_RUN_NOWAIT. The next call to uv_run() would return
  immediately without doing any work.
2013-02-25 17:01:02 +01:00
Saúl Ibarra Corretgé
bb3d1e24da unix, windows: add uv_stop, stop running event loop 2013-02-25 16:21:37 +01:00