From 52037d897d06fdb764e2fefc07352011b6a3f3d3 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 17 Aug 2011 06:45:21 +0200 Subject: [PATCH] uv: upgrade to 2dae0c9 --- deps/uv/src/unix/fs.c | 5 +++++ deps/uv/src/unix/internal.h | 4 ++++ deps/uv/src/unix/stream.c | 7 ++++--- deps/uv/test/test-fs.c | 4 ---- deps/uv/uv.gyp | 26 +++++++++----------------- 5 files changed, 22 insertions(+), 24 deletions(-) diff --git a/deps/uv/src/unix/fs.c b/deps/uv/src/unix/fs.c index 0623fe6b54..d745622835 100644 --- a/deps/uv/src/unix/fs.c +++ b/deps/uv/src/unix/fs.c @@ -447,7 +447,12 @@ int uv_fs_fsync(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb) { int uv_fs_fdatasync(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb) { char* path = NULL; +#ifdef __FreeBSD__ + /* freebsd doesn't have fdatasync, do a full fsync instead. */ + WRAP_EIO(UV_FS_FDATASYNC, eio_fdatasync, fsync, ARGS1(file)) +#else WRAP_EIO(UV_FS_FDATASYNC, eio_fdatasync, fdatasync, ARGS1(file)) +#endif } diff --git a/deps/uv/src/unix/internal.h b/deps/uv/src/unix/internal.h index c30ef6e44d..98fc51fc67 100644 --- a/deps/uv/src/unix/internal.h +++ b/deps/uv/src/unix/internal.h @@ -55,6 +55,10 @@ # define HAVE_FUTIMES #endif +#ifdef __FreeBSD__ +# define HAVE_FUTIMES +#endif + /* flags */ enum { UV_CLOSING = 0x00000001, /* uv_close() called but not finished. */ diff --git a/deps/uv/src/unix/stream.c b/deps/uv/src/unix/stream.c index be34df10c4..3983ca23b6 100644 --- a/deps/uv/src/unix/stream.c +++ b/deps/uv/src/unix/stream.c @@ -529,8 +529,8 @@ int uv_shutdown(uv_shutdown_t* req, uv_stream_t* stream, uv_shutdown_cb cb) { void uv__stream_io(EV_P_ ev_io* watcher, int revents) { uv_stream_t* stream = watcher->data; - assert(stream->type == UV_TCP || - stream->type == UV_NAMED_PIPE); + assert(stream->type == UV_TCP || stream->type == UV_NAMED_PIPE || + stream->type == UV_TTY); assert(watcher == &stream->read_watcher || watcher == &stream->write_watcher); assert(!(stream->flags & UV_CLOSING)); @@ -738,7 +738,8 @@ int uv_write(uv_write_t* req, uv_stream_t* stream, uv_buf_t bufs[], int bufcnt, int uv_read_start(uv_stream_t* stream, uv_alloc_cb alloc_cb, uv_read_cb read_cb) { - assert(stream->type == UV_TCP || stream->type == UV_NAMED_PIPE); + assert(stream->type == UV_TCP || stream->type == UV_NAMED_PIPE || + stream->type == UV_TTY); if (stream->flags & UV_CLOSING) { uv_err_new(stream->loop, EINVAL); diff --git a/deps/uv/test/test-fs.c b/deps/uv/test/test-fs.c index 0c115c1952..fbe0396bf8 100644 --- a/deps/uv/test/test-fs.c +++ b/deps/uv/test/test-fs.c @@ -424,14 +424,10 @@ static void check_utime(const char* path, double atime, double mtime) { ASSERT(s->st_mtime == mtime); #elif !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) ASSERT(s->st_atimespec.tv_sec == atime); - ASSERT(s->st_atimespec.tv_nsec == 0); /* FIXME check sub-second precision */ ASSERT(s->st_mtimespec.tv_sec == mtime); - ASSERT(s->st_mtimespec.tv_nsec == 0); /* FIXME check sub-second precision */ #else ASSERT(s->st_atim.tv_sec == atime); - ASSERT(s->st_atim.tv_nsec == 0); /* FIXME check sub-second precision */ ASSERT(s->st_mtim.tv_sec == mtime); - ASSERT(s->st_mtim.tv_nsec == 0); /* FIXME check sub-second precision */ #endif uv_fs_req_cleanup(&req); diff --git a/deps/uv/uv.gyp b/deps/uv/uv.gyp index 84c8c86e6d..6600a2f51a 100644 --- a/deps/uv/uv.gyp +++ b/deps/uv/uv.gyp @@ -163,23 +163,6 @@ 'src/unix/ev/ev_vars.h', 'src/unix/ev/ev_wrap.h', 'src/unix/ev/event.h', - # TODO: conditionally include the following based on OS? - 'src/ares/config_cygwin/ares_config.h', - 'src/ares/config_darwin/ares_config.h', - 'src/ares/config_freebsd/ares_config.h', - 'src/ares/config_linux/ares_config.h', - 'src/ares/config_openbsd/ares_config.h', - 'src/ares/config_sunos/ares_config.h', - 'src/unix/eio/config_cygwin.h', - 'src/unix/eio/config_darwin.h', - 'src/unix/eio/config_freebsd.h', - 'src/unix/eio/config_linux.h', - 'src/unix/eio/config_sunos.h', - 'src/unix/ev/config_cygwin.h', - 'src/unix/ev/config_darwin.h', - 'src/unix/ev/config_freebsd.h', - 'src/unix/ev/config_linux.h', - 'src/unix/ev/config_sunos.h', ], 'include_dirs': [ 'src/unix/ev', ], 'defines': [ @@ -228,6 +211,14 @@ 'libraries': [ '-lrt' ], }, }], + [ 'OS=="freebsd"', { + 'include_dirs': [ 'src/ares/config_freebsd' ], + 'sources': [ 'src/unix/freebsd.c' ], + 'defines': [ + 'EV_CONFIG_H="config_freebsd.h"', + 'EIO_CONFIG_H="config_freebsd.h"', + ], + }], ] }, @@ -269,6 +260,7 @@ 'test/test-threadpool.c', 'test/test-timer-again.c', 'test/test-timer.c', + 'test/test-tty.c', 'test/test-udp-dgram-too-big.c', 'test/test-udp-ipv6.c', 'test/test-udp-send-and-recv.c',