From c619f37c3986b0ec5d13fb7f2437dff0db41c72b Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Wed, 10 Jun 2015 17:18:34 -0700 Subject: [PATCH] win,fs: don't close fd 0-2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/libuv/libuv/pull/396 Reviewed-By: Saúl Ibarra Corretgé --- src/win/fs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/win/fs.c b/src/win/fs.c index 00d0197a..88d0ff5c 100644 --- a/src/win/fs.c +++ b/src/win/fs.c @@ -528,7 +528,11 @@ void fs__close(uv_fs_t* req) { VERIFY_FD(fd, req); - result = _close(fd); + if (fd > 2) + result = _close(fd); + else + result = 0; + SET_REQ_RESULT(req, result); }