From 17ee7732c333d046c50c391afcdc3b64ebf177c0 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Fri, 1 Jul 2011 11:52:51 -0400 Subject: [PATCH] unix: All objects should be compiled with _LARGEFILE_SOURCE and _FILE_OFFSET_BITS=64 Fixes uv_getaddrinfo on linux --- config-unix.mk | 5 +++-- uv-unix.c | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/config-unix.mk b/config-unix.mk index f63bbb22..5e51bb87 100644 --- a/config-unix.mk +++ b/config-unix.mk @@ -24,6 +24,9 @@ E= CFLAGS=--std=gnu89 -Wno-variadic-macros -g LINKFLAGS=-lm +CPPFLAGS += -D_LARGEFILE_SOURCE +CPPFLAGS += -D_FILE_OFFSET_BITS=64 + ifeq (SunOS,$(uname_S)) EV_CONFIG=config_sunos.h EIO_CONFIG=config_sunos.h @@ -83,8 +86,6 @@ ev/ev.o: ev/ev.c EIO_CPPFLAGS += $(CPPFLAGS) EIO_CPPFLAGS += -DEIO_CONFIG_H=\"$(EIO_CONFIG)\" EIO_CPPFLAGS += -DEIO_STACKSIZE=65536 -EIO_CPPFLAGS += -D_LARGEFILE_SOURCE -EIO_CPPFLAGS += -D_FILE_OFFSET_BITS=64 EIO_CPPFLAGS += -D_GNU_SOURCE eio/eio.o: eio/eio.c diff --git a/uv-unix.c b/uv-unix.c index 77fcfce8..db3ce118 100644 --- a/uv-unix.c +++ b/uv-unix.c @@ -1555,12 +1555,12 @@ int uv_getaddrinfo(uv_getaddrinfo_t* handle, /* TODO check handle->hostname == NULL */ /* TODO check handle->service == NULL */ + uv_ref(); + eio_req* req = eio_custom(getaddrinfo_thread_proc, EIO_PRI_DEFAULT, uv_getaddrinfo_done, handle); - - /* TODO check req == NULL ? */ - - uv_ref(); + assert(req); + assert(req->data == handle); return 0; }