Skip to content

Commit

Permalink
deps: upgrade libuv to joyent/libuv@4bdb7d8
Browse files Browse the repository at this point in the history
Non-release upgrade so pending patches can land.
  • Loading branch information
bnoordhuis committed Jul 30, 2013
1 parent 4cc57b4 commit 3ff2cbc
Show file tree
Hide file tree
Showing 26 changed files with 515 additions and 100 deletions.
1 change: 1 addition & 0 deletions deps/uv/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ vgcore.*
/aclocal.m4
/ar-lib
/autom4te.cache/
/compile
/config.guess
/config.log
/config.status
Expand Down
26 changes: 25 additions & 1 deletion deps/uv/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
2013.07.21, Version 0.11.6 (Unstable)
2013.07.26, Version 0.10.13 (Stable), 381312e1fe6fecbabc943ccd56f0e7d114b3d064

Changes since version 0.10.12:

* unix, windows: fix uv_fs_chown() function prototype (Ben Noordhuis)


2013.07.21, Version 0.11.6 (Unstable), 6645b93273e0553d23823c576573b82b129bf28c

Changes since version 0.11.5:

Expand Down Expand Up @@ -41,6 +48,23 @@ Changes since version 0.11.5:
* unix, windows: return error codes directly (Ben Noordhuis)


2013.07.10, Version 0.10.12 (Stable), 58a46221bba726746887a661a9f36fe9ff204209

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.27, Version 0.11.5 (Unstable), e3c63ff1627a14e96f54c1c62b0d68b446d8425b

Changes since version 0.11.4:
Expand Down
14 changes: 8 additions & 6 deletions deps/uv/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -200,24 +200,26 @@ endif
if DTRACE_NEEDS_OBJECTS
libuv_la_SOURCES += src/unix/uv-dtrace.d
libuv_la_DEPENDENCIES = src/unix/uv-dtrace.o
libuv_la_LIBADD = src/unix/uv-dtrace.lo
libuv_la_LIBADD = uv-dtrace.lo
CLEANFILES += src/unix/uv-dtrace.o src/unix/uv-dtrace.lo
endif

SUFFIXES = .d

include/uv-dtrace.h: src/unix/uv-dtrace.d
$(AM_V_GEN)$(DTRACE) $(DTRACEFLAGS) -h -xnolibs -s $< -o $@
$(AM_V_GEN)$(DTRACE) $(DTRACEFLAGS) -h -xnolibs -s $< -o $(top_srcdir)/$@

src/unix/uv-dtrace.o: src/unix/uv-dtrace.d ${libuv_la_OBJECTS}

# It's ok to specify the output here, because we have 1 .d file, and we process
# every created .o, most projects don't need to include more than one .d
.d.o:
$(AM_V_GEN)$(DTRACE) $(DTRACEFLAGS) -G -o $@ -s $< \
`grep '^pic_object' ${top_builddir}/*.lo | cut -f 2 -d\'`
$(AM_V_GEN)$(DTRACE) $(DTRACEFLAGS) -G -o $(top_builddir)/uv-dtrace.o -s $< \
`grep '^pic_object' $$(find ${top_builddir} -name "*.lo") | cut -f 2 -d\'`
$(AM_V_GEN)printf %s\\n \
'# $(patsubst %.o, %.lo, $@) - a libtool object file' \
'# ${top_builddir}/uv-dtrace.lo - a libtool object file' \
'# Generated by libtool (GNU libtool) 2.4' \
'# libtool wants a .lo not a .o' \
"pic_object='uv-dtrace.o'" \
"non_pic_object='uv-dtrace.o'" \
> $(patsubst %.o, %.lo, $@)
> ${top_builddir}/uv-dtrace.lo
75 changes: 75 additions & 0 deletions deps/uv/Makefile.mingw
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Copyright (c) 2013, Ben Noordhuis <[email protected]>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

CFLAGS = -Wall \
-Wextra \
-Wno-unused-parameter \
-Iinclude \
-Isrc \
-Isrc/win \
-DWIN32_LEAN_AND_MEAN \
-D_WIN32_WINNT=0x0600

INCLUDES = include/stdint-msvc2008.h \
include/tree.h \
include/uv-errno.h \
include/uv-win.h \
include/uv.h \
src/queue.h \
src/uv-common.h \
src/win/atomicops-inl.h \
src/win/handle-inl.h \
src/win/internal.h \
src/win/req-inl.h \
src/win/stream-inl.h \
src/win/winapi.h \
src/win/winsock.h

OBJS = src/fs-poll.o \
src/inet.o \
src/uv-common.o \
src/version.o \
src/win/async.o \
src/win/core.o \
src/win/dl.o \
src/win/error.o \
src/win/fs-event.o \
src/win/fs.o \
src/win/getaddrinfo.o \
src/win/handle.o \
src/win/loop-watcher.o \
src/win/pipe.o \
src/win/poll.o \
src/win/process-stdio.o \
src/win/process.o \
src/win/req.o \
src/win/signal.o \
src/win/stream.o \
src/win/tcp.o \
src/win/thread.o \
src/win/threadpool.o \
src/win/timer.o \
src/win/tty.o \
src/win/udp.o \
src/win/util.o \
src/win/winapi.o \
src/win/winsock.o

all: libuv.a

libuv.a: $(OBJS)
$(AR) crs $@ $^

# FIXME(bnoordhuis) Don't rebuild everything when a source file changes.
$(OBJS): $(OBJS:.o=.c) $(INCLUDES)
3 changes: 2 additions & 1 deletion deps/uv/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@

AC_PREREQ(2.57)
AC_INIT([libuv], [0.11.5], [https://github.com/joyent/libuv/issues])
AM_INIT_AUTOMAKE([foreign -Wall -Werror])
AM_INIT_AUTOMAKE([foreign subdir-objects -Wall -Werror])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_HOST
AC_ENABLE_SHARED
AC_ENABLE_STATIC
AC_PROG_CC
AM_PROG_CC_C_O
# AM_PROG_AR is not available in automake v0.11 but it's essential in v0.12.
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
Expand Down
4 changes: 2 additions & 2 deletions deps/uv/include/uv-unix.h
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ typedef struct {
void* buf; \
size_t len; \
off_t off; \
uid_t uid; \
gid_t gid; \
uv_uid_t uid; \
uv_gid_t gid; \
double atime; \
double mtime; \
struct uv__work work_req; \
Expand Down
13 changes: 10 additions & 3 deletions deps/uv/include/uv.h
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,12 @@ UV_EXTERN int uv_backend_timeout(const uv_loop_t*);
*
* `suggested_size` is a hint. Returning a buffer that is smaller is perfectly
* okay as long as `buf.len > 0`.
*
* If you return a buffer with `buf.len == 0`, libuv skips the read and calls
* your read or recv callback with nread=UV_ENOBUFS.
*
* Note that returning a zero-length buffer does not stop the handle, call
* uv_read_stop() or uv_udp_recv_stop() for that.
*/
typedef uv_buf_t (*uv_alloc_cb)(uv_handle_t* handle, size_t suggested_size);

Expand Down Expand Up @@ -1520,6 +1526,7 @@ struct uv_cpu_info_s {

struct uv_interface_address_s {
char* name;
char phys_addr[6];
int is_internal;
union {
struct sockaddr_in address4;
Expand Down Expand Up @@ -1625,7 +1632,7 @@ UV_EXTERN int uv_fs_unlink(uv_loop_t* loop, uv_fs_t* req, const char* path,
uv_fs_cb cb);

UV_EXTERN int uv_fs_write(uv_loop_t* loop, uv_fs_t* req, uv_file file,
void* buf, size_t length, int64_t offset, uv_fs_cb cb);
const void* buf, size_t length, int64_t offset, uv_fs_cb cb);

UV_EXTERN int uv_fs_mkdir(uv_loop_t* loop, uv_fs_t* req, const char* path,
int mode, uv_fs_cb cb);
Expand Down Expand Up @@ -1694,10 +1701,10 @@ UV_EXTERN int uv_fs_fchmod(uv_loop_t* loop, uv_fs_t* req, uv_file file,
int mode, uv_fs_cb cb);

UV_EXTERN int uv_fs_chown(uv_loop_t* loop, uv_fs_t* req, const char* path,
int uid, int gid, uv_fs_cb cb);
uv_uid_t uid, uv_gid_t gid, uv_fs_cb cb);

UV_EXTERN int uv_fs_fchown(uv_loop_t* loop, uv_fs_t* req, uv_file file,
int uid, int gid, uv_fs_cb cb);
uv_uid_t uid, uv_gid_t gid, uv_fs_cb cb);


enum uv_fs_event {
Expand Down
4 changes: 2 additions & 2 deletions deps/uv/src/unix/aix.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ int uv_interface_addresses(uv_interface_address_t** addresses,
memcpy(flg.ifr_name, p->ifr_name, sizeof(flg.ifr_name));
if (ioctl(sockfd, SIOCGIFFLAGS, &flg) == -1) {
close(sockfd);
return uv__new_artificial_error(UV_ENOSYS);
return -ENOSYS;
}

if (!(flg.ifr_flags & IFF_UP && flg.ifr_flags & IFF_RUNNING))
Expand Down Expand Up @@ -349,7 +349,7 @@ int uv_interface_addresses(uv_interface_address_t** addresses,
memcpy(flg.ifr_name, p->ifr_name, sizeof(flg.ifr_name));
if (ioctl(sockfd, SIOCGIFFLAGS, &flg) == -1) {
close(sockfd);
return uv__new_artificial_error(UV_ENOSYS);
return -ENOSYS;
}

if (!(flg.ifr_flags & IFF_UP && flg.ifr_flags & IFF_RUNNING))
Expand Down
35 changes: 27 additions & 8 deletions deps/uv/src/unix/darwin.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#include <ifaddrs.h>
#include <net/if.h>
#include <net/if_dl.h>

#include <CoreFoundation/CFRunLoop.h>

Expand Down Expand Up @@ -355,6 +356,8 @@ void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count) {
int uv_interface_addresses(uv_interface_address_t** addresses, int* count) {
struct ifaddrs *addrs, *ent;
uv_interface_address_t* address;
int i;
struct sockaddr_dl *sa_addr;

if (getifaddrs(&addrs))
return -errno;
Expand All @@ -363,7 +366,7 @@ int uv_interface_addresses(uv_interface_address_t** addresses, int* count) {

/* Count the number of interfaces */
for (ent = addrs; ent != NULL; ent = ent->ifa_next) {
if (!(ent->ifa_flags & IFF_UP && ent->ifa_flags & IFF_RUNNING) ||
if (!((ent->ifa_flags & IFF_UP) && (ent->ifa_flags & IFF_RUNNING)) ||
(ent->ifa_addr == NULL) ||
(ent->ifa_addr->sa_family == AF_LINK)) {
continue;
Expand All @@ -379,21 +382,18 @@ int uv_interface_addresses(uv_interface_address_t** addresses, int* count) {
address = *addresses;

for (ent = addrs; ent != NULL; ent = ent->ifa_next) {
if (!(ent->ifa_flags & IFF_UP && ent->ifa_flags & IFF_RUNNING)) {
if (!((ent->ifa_flags & IFF_UP) && (ent->ifa_flags & IFF_RUNNING)))
continue;
}

if (ent->ifa_addr == NULL) {
if (ent->ifa_addr == NULL)
continue;
}

/*
* On Mac OS X getifaddrs returns information related to Mac Addresses for
* various devices, such as firewire, etc. These are not relevant here.
*/
if (ent->ifa_addr->sa_family == AF_LINK) {
if (ent->ifa_addr->sa_family == AF_LINK)
continue;
}

address->name = strdup(ent->ifa_name);

Expand All @@ -409,11 +409,30 @@ int uv_interface_addresses(uv_interface_address_t** addresses, int* count) {
address->netmask.netmask4 = *((struct sockaddr_in*) ent->ifa_netmask);
}

address->is_internal = ent->ifa_flags & IFF_LOOPBACK ? 1 : 0;
address->is_internal = !!(ent->ifa_flags & IFF_LOOPBACK);

address++;
}

/* Fill in physical addresses for each interface */
for (ent = addrs; ent != NULL; ent = ent->ifa_next) {
if (!((ent->ifa_flags & IFF_UP) && (ent->ifa_flags & IFF_RUNNING)) ||
(ent->ifa_addr == NULL) ||
(ent->ifa_addr->sa_family != AF_LINK)) {
continue;
}

address = *addresses;

for (i = 0; i < (*count); i++) {
if (strcmp(address->name, ent->ifa_name) == 0) {
sa_addr = (struct sockaddr_dl*)(ent->ifa_addr);
memcpy(address->phys_addr, LLADDR(sa_addr), sizeof(address->phys_addr));
}
address++;
}
}

freeifaddrs(addrs);

return 0;
Expand Down
Loading

0 comments on commit 3ff2cbc

Please sign in to comment.