Skip to content

Commit

Permalink
fix #4213. seriously, that was all that was needed?
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash committed Nov 29, 2013
1 parent f0ec45d commit d2a088b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,10 @@ void *init_stdio_handle(uv_file fd,int readable)
// On windows however, libuv objects remember streams by their HANDLE, so this is
// unnessecary.
fd = dup(fd);
#else
// Duplicate the file descritor so libuv can later close it without having to worry
// about needing to keep its handle open
fd = _dup(fd);
#endif
//printf("%d: %d -- %d\n", fd, type, 0);
switch(type) {
Expand Down
4 changes: 2 additions & 2 deletions src/jl_uv.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ DLLEXPORT void jl_uv_shutdownCallback(uv_shutdown_t* req, int status)
* in the shutdown request (in that case we call uv_close, thus cancelling this)
* request.
*/
if (status != UV__ECANCELED) {
if (status != UV__ECANCELED && !uv_is_closing((uv_handle_t*)req->handle)) {
uv_close((uv_handle_t*) req->handle, &jl_uv_closeHandle);
}
free(req);
Expand Down Expand Up @@ -299,7 +299,7 @@ DLLEXPORT void jl_close_uv(uv_handle_t *handle)
fd->file = -1;
}
}
else {
else if (!uv_is_closing((uv_handle_t*)handle)) {
uv_close(handle,&jl_uv_closeHandle);
}
}
Expand Down

0 comments on commit d2a088b

Please sign in to comment.