Browse Source

uv: Upgrade to v0.10.12

v0.10.13-release
isaacs 11 years ago
parent
commit
8bac8857f5
  1. 1
      deps/uv/AUTHORS
  2. 19
      deps/uv/ChangeLog
  3. 7
      deps/uv/build.mk
  4. 2
      deps/uv/checksparse.sh
  5. 1
      deps/uv/common.gypi
  6. 9
      deps/uv/config-unix.mk
  7. 1
      deps/uv/gyp_uv
  8. 21
      deps/uv/src/unix/linux-core.c
  9. 2
      deps/uv/src/unix/thread.c
  10. 2
      deps/uv/src/version.c
  11. 2
      deps/uv/src/win/process.c
  12. 6
      deps/uv/src/win/tcp.c
  13. 3
      deps/uv/test/test-fs.c
  14. 2
      deps/uv/test/test-list.h
  15. 80
      deps/uv/test/test-timer-from-check.c
  16. 4
      deps/uv/test/test-tty.c
  17. 1
      deps/uv/uv.gyp

1
deps/uv/AUTHORS

@ -84,3 +84,4 @@ Nicholas Vavilov <vvnicholas@gmail.com>
Miroslav Bajtoš <miro.bajtos@gmail.com> Miroslav Bajtoš <miro.bajtos@gmail.com>
Elliot Saba <staticfloat@gmail.com> Elliot Saba <staticfloat@gmail.com>
Wynn Wilkes <wynnw@movenetworks.com> Wynn Wilkes <wynnw@movenetworks.com>
Andrei Sedoi <bsnote@gmail.com>

19
deps/uv/ChangeLog

@ -1,4 +1,21 @@
2013.06.13, Version 0.10.11 (Stable) 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.06.13, Version 0.10.11 (Stable), c3b75406a66a10222a589cb173e8f469e9665c7e
Changes since version 0.10.10: Changes since version 0.10.10:

7
deps/uv/build.mk

@ -130,6 +130,7 @@ TESTS= \
test/test-threadpool.o \ test/test-threadpool.o \
test/test-threadpool-cancel.o \ test/test-threadpool-cancel.o \
test/test-timer-again.o \ test/test-timer-again.o \
test/test-timer-from-check.o \
test/test-timer.o \ test/test-timer.o \
test/test-tty.o \ test/test-tty.o \
test/test-udp-dgram-too-big.o \ test/test-udp-dgram-too-big.o \
@ -142,7 +143,7 @@ TESTS= \
test/test-util.o \ test/test-util.o \
test/test-walk-handles.o \ test/test-walk-handles.o \
all: libuv.a .PHONY: all bench clean clean-platform distclean test
run-tests$(E): test/run-tests.o test/runner.o $(RUNNER_SRC) $(TESTS) libuv.a run-tests$(E): test/run-tests.o test/runner.o $(RUNNER_SRC) $(TESTS) libuv.a
$(CC) $(CPPFLAGS) $(RUNNER_CFLAGS) -o $@ $^ $(RUNNER_LIBS) $(RUNNER_LDFLAGS) $(CC) $(CPPFLAGS) $(RUNNER_CFLAGS) -o $@ $^ $(RUNNER_LIBS) $(RUNNER_LDFLAGS)
@ -152,10 +153,6 @@ run-benchmarks$(E): test/run-benchmarks.o test/runner.o $(RUNNER_SRC) $(BENCHMAR
test/echo.o: test/echo.c test/echo.h test/echo.o: test/echo.c test/echo.h
.PHONY: clean clean-platform distclean test bench
test: run-tests$(E) test: run-tests$(E)
$(CURDIR)/$< $(CURDIR)/$<

2
deps/uv/checksparse.sh

@ -222,7 +222,7 @@ SunOS)
;; ;;
esac esac
for ARCH in __i386__ __x86_64__ __arm__; do for ARCH in __i386__ __x86_64__ __arm__ __mips__; do
$SPARSE $SPARSE_FLAGS -D$ARCH=1 $SOURCES $SPARSE $SPARSE_FLAGS -D$ARCH=1 $SOURCES
done done

1
deps/uv/common.gypi

@ -36,6 +36,7 @@
}, },
'xcode_settings': { 'xcode_settings': {
'GCC_OPTIMIZATION_LEVEL': '0', 'GCC_OPTIMIZATION_LEVEL': '0',
'OTHER_CFLAGS': [ '-Wno-strict-aliasing' ],
}, },
'conditions': [ 'conditions': [
['OS != "win"', { ['OS != "win"', {

9
deps/uv/config-unix.mk

@ -29,7 +29,7 @@ CPPFLAGS += -D_FILE_OFFSET_BITS=64
RUNNER_SRC=test/runner-unix.c RUNNER_SRC=test/runner-unix.c
RUNNER_CFLAGS=$(CFLAGS) -I$(SRCDIR)/test RUNNER_CFLAGS=$(CFLAGS) -I$(SRCDIR)/test
RUNNER_LDFLAGS=-L"$(CURDIR)" -luv RUNNER_LDFLAGS=
DTRACE_OBJS= DTRACE_OBJS=
DTRACE_HEADER= DTRACE_HEADER=
@ -159,6 +159,13 @@ endif
RUNNER_LDFLAGS += $(LDFLAGS) RUNNER_LDFLAGS += $(LDFLAGS)
all:
# Force a sequential build of the static and the shared library.
# Works around a make quirk where it forgets to (re)build either
# the *.o or *.pic.o files, depending on what target comes first.
$(MAKE) -f $(SRCDIR)/Makefile libuv.a
$(MAKE) -f $(SRCDIR)/Makefile libuv.$(SOEXT)
libuv.a: $(OBJS) libuv.a: $(OBJS)
$(AR) rcs $@ $^ $(AR) rcs $@ $^

1
deps/uv/gyp_uv

@ -24,6 +24,7 @@ def host_arch():
if machine == 'i386': return 'ia32' if machine == 'i386': return 'ia32'
if machine == 'x86_64': return 'x64' if machine == 'x86_64': return 'x64'
if machine.startswith('arm'): return 'arm' if machine.startswith('arm'): return 'arm'
if machine.startswith('mips'): return 'mips'
return machine # Return as-is and hope for the best. return machine # Return as-is and hope for the best.

21
deps/uv/src/unix/linux-core.c

@ -427,7 +427,7 @@ static int read_models(unsigned int numcpus, uv_cpu_info_t* ci) {
char* model; char* model;
FILE* fp; FILE* fp;
/* Most are unused on non-ARM and non-x86 architectures. */ /* Most are unused on non-ARM, non-MIPS and non-x86 architectures. */
(void) &model_marker; (void) &model_marker;
(void) &speed_marker; (void) &speed_marker;
(void) &speed_idx; (void) &speed_idx;
@ -438,7 +438,10 @@ static int read_models(unsigned int numcpus, uv_cpu_info_t* ci) {
model_idx = 0; model_idx = 0;
speed_idx = 0; speed_idx = 0;
#if defined(__arm__) || defined(__i386__) || defined(__x86_64__) #if defined(__arm__) || \
defined(__i386__) || \
defined(__mips__) || \
defined(__x86_64__)
fp = fopen("/proc/cpuinfo", "r"); fp = fopen("/proc/cpuinfo", "r");
if (fp == NULL) if (fp == NULL)
return -1; return -1;
@ -456,10 +459,14 @@ static int read_models(unsigned int numcpus, uv_cpu_info_t* ci) {
continue; continue;
} }
} }
#if defined(__arm__) #if defined(__arm__) || defined(__mips__)
/* Fallback for pre-3.8 kernels. */
if (model_idx < numcpus) { if (model_idx < numcpus) {
#if defined(__arm__)
/* Fallback for pre-3.8 kernels. */
static const char model_marker[] = "Processor\t: "; static const char model_marker[] = "Processor\t: ";
#else /* defined(__mips__) */
static const char model_marker[] = "cpu model\t\t: ";
#endif
if (strncmp(buf, model_marker, sizeof(model_marker) - 1) == 0) { if (strncmp(buf, model_marker, sizeof(model_marker) - 1) == 0) {
model = buf + sizeof(model_marker) - 1; model = buf + sizeof(model_marker) - 1;
model = strndup(model, strlen(model) - 1); /* Strip newline. */ model = strndup(model, strlen(model) - 1); /* Strip newline. */
@ -471,18 +478,18 @@ static int read_models(unsigned int numcpus, uv_cpu_info_t* ci) {
continue; continue;
} }
} }
#else /* !__arm____ */ #else /* !__arm__ && !__mips__ */
if (speed_idx < numcpus) { if (speed_idx < numcpus) {
if (strncmp(buf, speed_marker, sizeof(speed_marker) - 1) == 0) { if (strncmp(buf, speed_marker, sizeof(speed_marker) - 1) == 0) {
ci[speed_idx++].speed = atoi(buf + sizeof(speed_marker) - 1); ci[speed_idx++].speed = atoi(buf + sizeof(speed_marker) - 1);
continue; continue;
} }
} }
#endif /* __arm__ */ #endif /* __arm__ || __mips__ */
} }
fclose(fp); fclose(fp);
#endif /* __arm__ || __i386__ || __x86_64__ */ #endif /* __arm__ || __i386__ || __mips__ || __x86_64__ */
/* Now we want to make sure that all the models contain *something* because /* Now we want to make sure that all the models contain *something* because
* it's not safe to leave them as null. Copy the last entry unless there * it's not safe to leave them as null. Copy the last entry unless there

2
deps/uv/src/unix/thread.c

@ -42,7 +42,7 @@ int uv_thread_join(uv_thread_t *tid) {
int uv_mutex_init(uv_mutex_t* mutex) { int uv_mutex_init(uv_mutex_t* mutex) {
#ifdef NDEBUG #if defined(NDEBUG) || !defined(PTHREAD_MUTEX_ERRORCHECK)
if (pthread_mutex_init(mutex, NULL)) if (pthread_mutex_init(mutex, NULL))
return -1; return -1;
else else

2
deps/uv/src/version.c

@ -34,7 +34,7 @@
#define UV_VERSION_MAJOR 0 #define UV_VERSION_MAJOR 0
#define UV_VERSION_MINOR 10 #define UV_VERSION_MINOR 10
#define UV_VERSION_PATCH 11 #define UV_VERSION_PATCH 12
#define UV_VERSION_IS_RELEASE 1 #define UV_VERSION_IS_RELEASE 1

2
deps/uv/src/win/process.c

@ -225,7 +225,7 @@ static WCHAR* search_path_join_test(const WCHAR* dir,
attrs = GetFileAttributesW(result); attrs = GetFileAttributesW(result);
if (attrs != INVALID_FILE_ATTRIBUTES && if (attrs != INVALID_FILE_ATTRIBUTES &&
!(attrs & (FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_REPARSE_POINT))) { !(attrs & FILE_ATTRIBUTE_DIRECTORY)) {
return result; return result;
} }

6
deps/uv/src/win/tcp.c

@ -50,7 +50,7 @@ static int uv__tcp_nodelay(uv_tcp_t* handle, SOCKET socket, int enable) {
TCP_NODELAY, TCP_NODELAY,
(const char*)&enable, (const char*)&enable,
sizeof enable) == -1) { sizeof enable) == -1) {
uv__set_sys_error(handle->loop, errno); uv__set_sys_error(handle->loop, WSAGetLastError());
return -1; return -1;
} }
return 0; return 0;
@ -63,7 +63,7 @@ static int uv__tcp_keepalive(uv_tcp_t* handle, SOCKET socket, int enable, unsign
SO_KEEPALIVE, SO_KEEPALIVE,
(const char*)&enable, (const char*)&enable,
sizeof enable) == -1) { sizeof enable) == -1) {
uv__set_sys_error(handle->loop, errno); uv__set_sys_error(handle->loop, WSAGetLastError());
return -1; return -1;
} }
@ -72,7 +72,7 @@ static int uv__tcp_keepalive(uv_tcp_t* handle, SOCKET socket, int enable, unsign
TCP_KEEPALIVE, TCP_KEEPALIVE,
(const char*)&delay, (const char*)&delay,
sizeof delay) == -1) { sizeof delay) == -1) {
uv__set_sys_error(handle->loop, errno); uv__set_sys_error(handle->loop, WSAGetLastError());
return -1; return -1;
} }

3
deps/uv/test/test-fs.c

@ -1391,7 +1391,8 @@ TEST_IMPL(fs_symlink_dir) {
#ifdef _WIN32 #ifdef _WIN32
ASSERT(((struct stat*)req.ptr)->st_size == strlen(test_dir + 4)); ASSERT(((struct stat*)req.ptr)->st_size == strlen(test_dir + 4));
#else #else
ASSERT(((struct stat*)req.ptr)->st_size == strlen(test_dir)); /* st_size has type off_t. Cast to avoid signed/unsigned warnings. */
ASSERT((size_t) ((struct stat*)req.ptr)->st_size == strlen(test_dir));
#endif #endif
uv_fs_req_cleanup(&req); uv_fs_req_cleanup(&req);

2
deps/uv/test/test-list.h

@ -101,6 +101,7 @@ TEST_DECLARE (timer_start_twice)
TEST_DECLARE (timer_order) TEST_DECLARE (timer_order)
TEST_DECLARE (timer_huge_timeout) TEST_DECLARE (timer_huge_timeout)
TEST_DECLARE (timer_huge_repeat) TEST_DECLARE (timer_huge_repeat)
TEST_DECLARE (timer_from_check)
TEST_DECLARE (idle_starvation) TEST_DECLARE (idle_starvation)
TEST_DECLARE (loop_handles) TEST_DECLARE (loop_handles)
TEST_DECLARE (get_loadavg) TEST_DECLARE (get_loadavg)
@ -348,6 +349,7 @@ TASK_LIST_START
TEST_ENTRY (timer_order) TEST_ENTRY (timer_order)
TEST_ENTRY (timer_huge_timeout) TEST_ENTRY (timer_huge_timeout)
TEST_ENTRY (timer_huge_repeat) TEST_ENTRY (timer_huge_repeat)
TEST_ENTRY (timer_from_check)
TEST_ENTRY (idle_starvation) TEST_ENTRY (idle_starvation)

80
deps/uv/test/test-timer-from-check.c

@ -0,0 +1,80 @@
/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
#include "uv.h"
#include "task.h"
static uv_prepare_t prepare_handle;
static uv_check_t check_handle;
static uv_timer_t timer_handle;
static int prepare_cb_called;
static int check_cb_called;
static int timer_cb_called;
static void prepare_cb(uv_prepare_t* handle, int status) {
ASSERT(0 == uv_prepare_stop(&prepare_handle));
ASSERT(0 == prepare_cb_called);
ASSERT(1 == check_cb_called);
ASSERT(0 == timer_cb_called);
prepare_cb_called++;
}
static void timer_cb(uv_timer_t* handle, int status) {
ASSERT(0 == uv_timer_stop(&timer_handle));
ASSERT(1 == prepare_cb_called);
ASSERT(1 == check_cb_called);
ASSERT(0 == timer_cb_called);
timer_cb_called++;
}
static void check_cb(uv_check_t* handle, int status) {
ASSERT(0 == uv_check_stop(&check_handle));
ASSERT(0 == uv_timer_stop(&timer_handle)); /* Runs before timer_cb. */
ASSERT(0 == uv_timer_start(&timer_handle, timer_cb, 50, 0));
ASSERT(0 == uv_prepare_start(&prepare_handle, prepare_cb));
ASSERT(0 == prepare_cb_called);
ASSERT(0 == check_cb_called);
ASSERT(0 == timer_cb_called);
check_cb_called++;
}
TEST_IMPL(timer_from_check) {
ASSERT(0 == uv_prepare_init(uv_default_loop(), &prepare_handle));
ASSERT(0 == uv_check_init(uv_default_loop(), &check_handle));
ASSERT(0 == uv_check_start(&check_handle, check_cb));
ASSERT(0 == uv_timer_init(uv_default_loop(), &timer_handle));
ASSERT(0 == uv_timer_start(&timer_handle, timer_cb, 50, 0));
ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT));
ASSERT(1 == prepare_cb_called);
ASSERT(1 == check_cb_called);
ASSERT(1 == timer_cb_called);
uv_close((uv_handle_t*) &prepare_handle, NULL);
uv_close((uv_handle_t*) &check_handle, NULL);
uv_close((uv_handle_t*) &timer_handle, NULL);
ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_ONCE));
MAKE_VALGRIND_HAPPY();
return 0;
}

4
deps/uv/test/test-tty.c

@ -81,10 +81,10 @@ TEST_IMPL(tty) {
ASSERT(UV_TTY == uv_guess_handle(ttyin_fd)); ASSERT(UV_TTY == uv_guess_handle(ttyin_fd));
ASSERT(UV_TTY == uv_guess_handle(ttyout_fd)); ASSERT(UV_TTY == uv_guess_handle(ttyout_fd));
r = uv_tty_init(uv_default_loop(), &tty_in, ttyin_fd, 1); r = uv_tty_init(uv_default_loop(), &tty_in, ttyin_fd, 1); /* Readable. */
ASSERT(r == 0); ASSERT(r == 0);
r = uv_tty_init(uv_default_loop(), &tty_out, ttyout_fd, 2); r = uv_tty_init(uv_default_loop(), &tty_out, ttyout_fd, 0); /* Writable. */
ASSERT(r == 0); ASSERT(r == 0);
r = uv_tty_get_winsize(&tty_out, &width, &height); r = uv_tty_get_winsize(&tty_out, &width, &height);

1
deps/uv/uv.gyp

@ -353,6 +353,7 @@
'test/test-barrier.c', 'test/test-barrier.c',
'test/test-condvar.c', 'test/test-condvar.c',
'test/test-timer-again.c', 'test/test-timer-again.c',
'test/test-timer-from-check.c',
'test/test-timer.c', 'test/test-timer.c',
'test/test-tty.c', 'test/test-tty.c',
'test/test-udp-dgram-too-big.c', 'test/test-udp-dgram-too-big.c',

Loading…
Cancel
Save