Browse Source

deps: upgrade libuv to fc5984f

v0.9.4-release
Ben Noordhuis 12 years ago
parent
commit
8ba1bec47d
  1. 11
      deps/uv/config-unix.mk
  2. 26
      deps/uv/src/unix/freebsd.c
  3. 7
      deps/uv/src/unix/fs.c
  4. 16
      deps/uv/src/unix/internal.h
  5. 3
      deps/uv/src/unix/udp.c
  6. 2
      deps/uv/test/benchmark-udp-pummel.c
  7. 2
      deps/uv/test/test-fs-event.c
  8. 4
      deps/uv/uv.gyp

11
deps/uv/config-unix.mk

@ -55,7 +55,6 @@ OBJS += src/uv-common.o
OBJS += src/inet.o
ifeq (SunOS,$(uname_S))
EV_CONFIG=config_sunos.h
CPPFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=500
LINKFLAGS+=-lkstat -lnsl -lsendfile -lsocket
# Library dependencies are not transitive.
@ -64,14 +63,12 @@ OBJS += src/unix/sunos.o
endif
ifeq (AIX,$(uname_S))
EV_CONFIG=config_aix.h
CPPFLAGS += -Isrc/ares/config_aix -D_ALL_SOURCE -D_XOPEN_SOURCE=500
LINKFLAGS+= -lperfstat
OBJS += src/unix/aix.o
endif
ifeq (Darwin,$(uname_S))
EV_CONFIG=config_darwin.h
CPPFLAGS += -D_DARWIN_USE_64_BIT_INODE=1
LINKFLAGS+=-framework CoreServices -dynamiclib -install_name "@rpath/libuv.dylib"
SOEXT = dylib
@ -81,7 +78,6 @@ OBJS += src/unix/fsevents.o
endif
ifeq (Linux,$(uname_S))
EV_CONFIG=config_linux.h
CSTDFLAG += -D_GNU_SOURCE
LINKFLAGS+=-ldl -lrt
RUNNER_CFLAGS += -D_GNU_SOURCE
@ -91,35 +87,30 @@ OBJS += src/unix/linux/linux-core.o \
endif
ifeq (FreeBSD,$(uname_S))
EV_CONFIG=config_freebsd.h
LINKFLAGS+=-lkvm
OBJS += src/unix/freebsd.o
OBJS += src/unix/kqueue.o
endif
ifeq (DragonFly,$(uname_S))
EV_CONFIG=config_freebsd.h
LINKFLAGS+=
LINKFLAGS+=-lkvm
OBJS += src/unix/freebsd.o
OBJS += src/unix/kqueue.o
endif
ifeq (NetBSD,$(uname_S))
EV_CONFIG=config_netbsd.h
LINKFLAGS+=-lkvm
OBJS += src/unix/netbsd.o
OBJS += src/unix/kqueue.o
endif
ifeq (OpenBSD,$(uname_S))
EV_CONFIG=config_openbsd.h
LINKFLAGS+=-lkvm
OBJS += src/unix/openbsd.o
OBJS += src/unix/kqueue.o
endif
ifneq (,$(findstring CYGWIN,$(uname_S)))
EV_CONFIG=config_cygwin.h
# We drop the --std=c89, it hides CLOCK_MONOTONIC on cygwin
CSTDFLAG = -D_GNU_SOURCE
LINKFLAGS+=

26
deps/uv/src/unix/freebsd.c

@ -235,12 +235,26 @@ uv_err_t uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) {
multiplier = ((uint64_t)1000L / ticks), cpuspeed, maxcpus,
cur = 0;
uv_cpu_info_t* cpu_info;
const char* maxcpus_key;
const char* cptimes_key;
char model[512];
long* cp_times;
int numcpus;
size_t size;
int i;
#if defined(__DragonFly__)
/* This is not quite correct but DragonFlyBSD doesn't seem to have anything
* comparable to kern.smp.maxcpus or kern.cp_times (kern.cp_time is a total,
* not per CPU). At least this stops uv_cpu_info() from failing completely.
*/
maxcpus_key = "hw.ncpu";
cptimes_key = "kern.cp_time";
#else
maxcpus_key = "kern.smp.maxcpus";
cptimes_key = "kern.cp_times";
#endif
size = sizeof(model);
if (sysctlbyname("hw.model", &model, &size, NULL, 0) < 0) {
return uv__new_sys_error(errno);
@ -262,19 +276,13 @@ uv_err_t uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) {
free(*cpu_infos);
return uv__new_sys_error(errno);
}
/* kern.cp_times on FreeBSD i386 gives an array up to maxcpus instead of ncpu */
size = sizeof(maxcpus);
#ifdef __DragonFly__
if (sysctlbyname("hw.ncpu", &maxcpus, &size, NULL, 0) < 0) {
if (sysctlbyname(maxcpus_key, &maxcpus, &size, NULL, 0) < 0) {
free(*cpu_infos);
return uv__new_sys_error(errno);
}
#else
if (sysctlbyname("kern.smp.maxcpus", &maxcpus, &size, NULL, 0) < 0) {
free(*cpu_infos);
return uv__new_sys_error(errno);
}
#endif
size = maxcpus * CPUSTATES * sizeof(long);
@ -284,7 +292,7 @@ uv_err_t uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) {
return uv__new_sys_error(ENOMEM);
}
if (sysctlbyname("kern.cp_times", cp_times, &size, NULL, 0) < 0) {
if (sysctlbyname(cptimes_key, cp_times, &size, NULL, 0) < 0) {
free(cp_times);
free(*cpu_infos);
return uv__new_sys_error(errno);

7
deps/uv/src/unix/fs.c

@ -119,14 +119,17 @@ static ssize_t uv__fs_futime(uv_fs_t* req) {
ts[1].tv_sec = req->mtime;
ts[1].tv_nsec = (unsigned long)(req->mtime * 1000000) % 1000000 * 1000;
return uv__utimesat(req->file, NULL, ts, 0);
#elif HAVE_FUTIMES
#elif defined(__APPLE__) \
|| defined(__DragonFly__) \
|| defined(__FreeBSD__) \
|| defined(__sun)
struct timeval tv[2];
tv[0].tv_sec = req->atime;
tv[0].tv_usec = (unsigned long)(req->atime * 1000000) % 1000000;
tv[1].tv_sec = req->mtime;
tv[1].tv_usec = (unsigned long)(req->mtime * 1000000) % 1000000;
return futimes(req->file, tv);
#else /* !HAVE_FUTIMES */
#else
errno = ENOSYS;
return -1;
#endif

16
deps/uv/src/unix/internal.h

@ -31,13 +31,10 @@
# define inline __inline
#endif
#undef HAVE_FUTIMES
#undef HAVE_KQUEUE
#undef HAVE_PORTS_FS
#if __linux__
# include "linux/syscalls.h"
# define HAVE_FUTIMES 1 /* emulated with utimesat() */
#endif /* __linux__ */
#if defined(__sun)
@ -46,22 +43,9 @@
# ifdef PORT_SOURCE_FILE
# define HAVE_PORTS_FS 1
# endif
# define HAVE_FUTIMES 1
# define futimes(fd, tv) futimesat(fd, (void*)0, tv)
#endif /* __sun */
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__sun)
# define HAVE_FUTIMES 1
#endif
/* FIXME exact copy of the #ifdef guard in uv-unix.h */
#if defined(__APPLE__) \
|| defined(__FreeBSD__) \
|| defined(__OpenBSD__) \
|| defined(__NetBSD__)
# define HAVE_KQUEUE 1
#endif
#if defined(__APPLE__) && !TARGET_OS_IPHONE
# include <CoreServices/CoreServices.h>
#endif

3
deps/uv/src/unix/udp.c

@ -68,8 +68,7 @@ void uv__udp_finish_close(uv_udp_t* handle) {
req->bufs = NULL;
if (req->send_cb) {
/* FIXME proper error code like UV_EABORTED */
uv__set_artificial_error(handle->loop, UV_EINTR);
uv__set_artificial_error(handle->loop, UV_ECANCELED);
req->send_cb(req, -1);
}
}

2
deps/uv/test/benchmark-udp-pummel.c

@ -73,7 +73,7 @@ static void send_cb(uv_udp_send_t* req, int status) {
if (status != 0) {
ASSERT(status == -1);
ASSERT(uv_last_error(req->handle->loop).code == UV_EINTR);
ASSERT(uv_last_error(req->handle->loop).code == UV_ECANCELED);
return;
}

2
deps/uv/test/test-fs-event.c

@ -26,7 +26,7 @@
#include <fcntl.h>
#ifndef HAVE_KQUEUE
# if __APPLE__ || __FreeBSD__ || __OpenBSD__ || __NetBSD__
# if __APPLE__ || __DragonFly__ || __FreeBSD__ || __OpenBSD__ || __NetBSD__
# define HAVE_KQUEUE 1
# endif
#endif

4
deps/uv/uv.gyp

@ -201,7 +201,7 @@
],
},
}],
[ 'OS=="freebsd"', {
[ 'OS=="freebsd" or OS=="dragonflybsd"', {
'sources': [ 'src/unix/freebsd.c' ],
'link_settings': {
'libraries': [
@ -220,7 +220,7 @@
],
},
}],
[ 'OS=="mac" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd"', {
[ 'OS in "mac freebsd dragonflybsd openbsd netbsd".split()', {
'sources': [ 'src/unix/kqueue.c' ],
}],
['library=="shared_library"', {

Loading…
Cancel
Save