Skip to content

Commit

Permalink
deps: upgrade libuv to 2a8d2a5
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoordhuis committed Mar 1, 2013
1 parent c53b921 commit bb43153
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 37 deletions.
4 changes: 2 additions & 2 deletions deps/uv/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ Makefile:: ;
# Turn everything else into a no-op rule that depends on the build directory.
%:: $(builddir_name) ;

.PHONY: clean
clean:
.PHONY: clean distclean
clean distclean:
$(RM) -fr $(builddir_name)

endif
12 changes: 6 additions & 6 deletions deps/uv/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ run-benchmarks$(E): test/run-benchmarks.o test/runner.o $(RUNNER_SRC) $(BENCHMAR
test/echo.o: test/echo.c test/echo.h


.PHONY: clean clean-platform distclean distclean-platform test bench
.PHONY: clean clean-platform distclean test bench


test: run-tests$(E)
Expand All @@ -157,8 +157,8 @@ test: run-tests$(E)
bench: run-benchmarks$(E)
$(CURDIR)/$<

clean: clean-platform
$(RM) -f *.a *.so test/run-tests$(E) test/run-benchmarks$(E)

distclean: distclean-platform
$(RM) -f *.a *.so test/run-tests$(E) test/run-benchmarks$(E)
clean distclean: clean-platform
$(RM) libuv.a libuv.$(SOEXT) \
test/run-tests.o test/run-benchmarks.o \
test/run-tests$(E) test/run-benchmarks$(E) \
$(BENCHMARKS) $(TESTS) $(RUNNER_LIBS)
3 changes: 0 additions & 3 deletions deps/uv/config-mingw.mk
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,3 @@ src/win/%.o: src/win/%.c include/uv.h include/uv-private/uv-win.h src/win/intern

clean-platform:
-rm -f src/win/*.o

distclean-platform:
-rm -f src/win/*.o
5 changes: 1 addition & 4 deletions deps/uv/config-unix.mk
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,7 @@ test/%.o: test/%.c include/uv.h test/.buildstamp
$(CC) $(CSTDFLAG) $(CPPFLAGS) $(CFLAGS) -c $< -o $@

clean-platform:
-rm -f libuv.a libuv.$(SOEXT) test/run-{tests,benchmarks}.dSYM

distclean-platform:
-rm -f libuv.a libuv.$(SOEXT) test/run-{tests,benchmarks}.dSYM
$(RM) test/run-{tests,benchmarks}.dSYM $(OBJS) $(OBJS:%.o=%.pic.o)

%.pic.o %.o: %.m
$(CC) $(CPPFLAGS) $(CFLAGS) -c $^ -o $@
24 changes: 17 additions & 7 deletions deps/uv/src/unix/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void uv__stream_init(uv_loop_t* loop,


#if defined(__APPLE__)
void uv__stream_osx_select(void* arg) {
static void uv__stream_osx_select(void* arg) {
uv_stream_t* stream;
uv__stream_select_t* s;
char buf[1024];
Expand Down Expand Up @@ -216,7 +216,7 @@ void uv__stream_osx_select(void* arg) {
}


void uv__stream_osx_interrupt_select(uv_stream_t* stream) {
static void uv__stream_osx_interrupt_select(uv_stream_t* stream) {
/* Notify select() thread about state change */
uv__stream_select_t* s;
int r;
Expand All @@ -235,7 +235,7 @@ void uv__stream_osx_interrupt_select(uv_stream_t* stream) {
}


void uv__stream_osx_select_cb(uv_async_t* handle, int status) {
static void uv__stream_osx_select_cb(uv_async_t* handle, int status) {
uv__stream_select_t* s;
uv_stream_t* stream;
int events;
Expand All @@ -260,15 +260,15 @@ void uv__stream_osx_select_cb(uv_async_t* handle, int status) {
}


void uv__stream_osx_cb_close(uv_handle_t* async) {
static void uv__stream_osx_cb_close(uv_handle_t* async) {
uv__stream_select_t* s;

s = container_of(async, uv__stream_select_t, async);
free(s);
}


int uv__stream_try_select(uv_stream_t* stream, int fd) {
static int uv__stream_try_select(uv_stream_t* stream, int fd) {
/*
* kqueue doesn't work with some files from /dev mount on osx.
* select(2) in separate thread for those fds
Expand Down Expand Up @@ -300,7 +300,7 @@ int uv__stream_try_select(uv_stream_t* stream, int fd) {
if (ret == -1)
return uv__set_sys_error(stream->loop, errno);

if ((events[0].flags & EV_ERROR) == 0 || events[0].data != EINVAL)
if (ret == 0 || (events[0].flags & EV_ERROR) == 0 || events[0].data != EINVAL)
return 0;

/* At this point we definitely know that this fd won't work with kqueue */
Expand Down Expand Up @@ -1200,7 +1200,13 @@ int uv_write2(uv_write_t* req,
if (stream->type != UV_NAMED_PIPE || !((uv_pipe_t*)stream)->ipc)
return uv__set_artificial_error(stream->loop, UV_EINVAL);

if (uv__stream_fd(send_handle) < 0)
/* XXX We abuse uv_write2() to send over UDP handles to child processes.
* Don't call uv__stream_fd() on those handles, it's a macro that on OS X
* evaluates to a function that operates on a uv_stream_t with a couple of
* OS X specific fields. On other Unices it does (handle)->io_watcher.fd,
* which works but only by accident.
*/
if (uv__handle_fd((uv_handle_t*) send_handle) < 0)
return uv__set_artificial_error(stream->loop, UV_EBADF);
}

Expand Down Expand Up @@ -1343,6 +1349,10 @@ int uv_is_writable(const uv_stream_t* stream) {
int uv___stream_fd(uv_stream_t* handle) {
uv__stream_select_t* s;

assert(handle->type == UV_TCP ||
handle->type == UV_TTY ||
handle->type == UV_NAMED_PIPE);

s = handle->select;
if (s != NULL)
return s->fd;
Expand Down
10 changes: 2 additions & 8 deletions deps/uv/test/runner-unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,9 @@

/* Do platform-specific initialization. */
void platform_init(int argc, char **argv) {
const char* var = getenv("UV_RUN_AS_ROOT");
const char* tap = getenv("UV_TAP_OUTPUT");

/* Running the tests as root is not smart - don't do it. */
if (getuid() == 0 && (var == NULL || atoi(var) <= 0)) {
fprintf(stderr, "Running the tests as root is not safe.\n");
exit(1);
}
const char* tap;

tap = getenv("UV_TAP_OUTPUT");
tap_output = (tap != NULL && atoi(tap) > 0);

/* Disable stdio output buffering. */
Expand Down
11 changes: 8 additions & 3 deletions deps/uv/test/runner.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,17 @@ int run_test(const char* test,
FATAL("process_wait failed");
}

if (tap_output) {
if (status == 0)
LOGF("ok %d - %s\n", test_count, test);
else
LOGF("not ok %d - %s\n", test_count, test);
}

/* Show error and output from processes if the test failed. */
if (status != 0 || task->show_output) {
if (tap_output) {
LOGF("not ok %d - %s\n#", test_count, test);
LOGF("#");
} else if (status != 0) {
LOGF("\n`%s` failed: %s\n", test, errmsg);
} else {
Expand Down Expand Up @@ -305,8 +312,6 @@ int run_test(const char* test,
}
break;
}
} else if (tap_output) {
LOGF("ok %d - %s\n", test_count, test);
}

/* Clean up all process handles. */
Expand Down
9 changes: 5 additions & 4 deletions deps/uv/vcbuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,11 @@ goto have_gyp
:gyp_install_failed
echo Failed to download gyp. Make sure you have git installed, or
echo manually install gyp into %~dp0build\gyp.
goto exit
exit /b 1

:have_gyp
python gyp_uv -Dtarget_arch=%target_arch% -Dlibrary=%library%
if not defined PYTHON set PYTHON="python"
%PYTHON% gyp_uv -Dtarget_arch=%target_arch% -Dlibrary=%library%
if errorlevel 1 goto create-msvs-files-failed
if not exist uv.sln goto create-msvs-files-failed
echo Project files generated.
Expand All @@ -102,7 +103,7 @@ goto run
@rem Build the sln with msbuild.
:msbuild-found
msbuild uv.sln /t:%target% /p:Configuration=%config% /p:Platform="%platform%" /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
if errorlevel 1 goto exit
if errorlevel 1 exit /b 1

:run
@rem Run tests if requested.
Expand All @@ -114,7 +115,7 @@ goto exit

:create-msvs-files-failed
echo Failed to create vc project files.
goto exit
exit /b 1

:help
echo vcbuild.bat [debug/release] [test/bench] [clean] [noprojgen] [nobuild] [x86/x64] [static/shared]
Expand Down

0 comments on commit bb43153

Please sign in to comment.