Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Revert "deps: upgrade libuv to fc5984f"

This reverts commit 8ba1bec.
  • Loading branch information...
commit 1053d01206538b7841b3a40ce475e17e8638e53f 1 parent 5489432
@isaacs authored
View
11 deps/uv/config-unix.mk
@@ -48,18 +48,21 @@ OBJS += src/unix/tty.o
OBJS += src/unix/udp.o
ifeq (SunOS,$(uname_S))
+EV_CONFIG=config_sunos.h
CPPFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=500
LINKFLAGS+=-lkstat -lnsl -lsendfile -lsocket
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
OBJS += src/unix/darwin.o
@@ -68,6 +71,7 @@ OBJS += src/unix/fsevents.o
endif
ifeq (Linux,$(uname_S))
+EV_CONFIG=config_linux.h
CSTDFLAG += -D_GNU_SOURCE
LINKFLAGS+=-ldl -lrt
OBJS += src/unix/linux/linux-core.o \
@@ -76,30 +80,35 @@ 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))
-LINKFLAGS+=-lkvm
+EV_CONFIG=config_freebsd.h
+LINKFLAGS+=
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+=
View
26 deps/uv/src/unix/freebsd.c
@@ -235,26 +235,12 @@ 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);
@@ -276,13 +262,19 @@ 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);
- if (sysctlbyname(maxcpus_key, &maxcpus, &size, NULL, 0) < 0) {
+#ifdef __DragonFly__
+ if (sysctlbyname("hw.ncpu", &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);
@@ -292,7 +284,7 @@ uv_err_t uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) {
return uv__new_sys_error(ENOMEM);
}
- if (sysctlbyname(cptimes_key, cp_times, &size, NULL, 0) < 0) {
+ if (sysctlbyname("kern.cp_times", cp_times, &size, NULL, 0) < 0) {
free(cp_times);
free(*cpu_infos);
return uv__new_sys_error(errno);
View
7 deps/uv/src/unix/fs.c
@@ -119,17 +119,14 @@ 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 defined(__APPLE__) \
- || defined(__DragonFly__) \
- || defined(__FreeBSD__) \
- || defined(__sun)
+#elif HAVE_FUTIMES
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
+#else /* !HAVE_FUTIMES */
errno = ENOSYS;
return -1;
#endif
View
16 deps/uv/src/unix/internal.h
@@ -31,10 +31,13 @@
# 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)
@@ -43,9 +46,22 @@
# 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
View
3  deps/uv/src/unix/udp.c
@@ -91,7 +91,8 @@ void uv__udp_finish_close(uv_udp_t* handle) {
req->bufs = NULL;
if (req->send_cb) {
- uv__set_artificial_error(handle->loop, UV_ECANCELED);
+ /* FIXME proper error code like UV_EABORTED */
+ uv__set_artificial_error(handle->loop, UV_EINTR);
req->send_cb(req, -1);
}
}
View
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_ECANCELED);
+ ASSERT(uv_last_error(req->handle->loop).code == UV_EINTR);
return;
}
View
2  deps/uv/test/test-fs-event.c
@@ -26,7 +26,7 @@
#include <fcntl.h>
#ifndef HAVE_KQUEUE
-# if __APPLE__ || __DragonFly__ || __FreeBSD__ || __OpenBSD__ || __NetBSD__
+# if __APPLE__ || __FreeBSD__ || __OpenBSD__ || __NetBSD__
# define HAVE_KQUEUE 1
# endif
#endif
View
4 deps/uv/uv.gyp
@@ -202,7 +202,7 @@
],
},
}],
- [ 'OS=="freebsd" or OS=="dragonflybsd"', {
+ [ 'OS=="freebsd"', {
'sources': [ 'src/unix/freebsd.c' ],
'defines': [
'EV_CONFIG_H="config_freebsd.h"',
@@ -230,7 +230,7 @@
],
},
}],
- [ 'OS in "mac freebsd dragonflybsd openbsd netbsd".split()', {
+ [ 'OS=="mac" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd"', {
'sources': [ 'src/unix/kqueue.c' ],
}],
['library=="shared_library"', {
Please sign in to comment.
Something went wrong with that request. Please try again.