From 78dcaa5cac4a53d7854005576f07dc536575cee0 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 27 Feb 2013 21:46:46 +0100 Subject: [PATCH] darwin: fix read from uninitialized struct kevent In the OS X fallback code, don't read from the struct when the kevent() syscall times out. --- src/unix/stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unix/stream.c b/src/unix/stream.c index 081d4954..a9d58f05 100644 --- a/src/unix/stream.c +++ b/src/unix/stream.c @@ -300,7 +300,7 @@ static 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 */