Skip to content
Snippets Groups Projects
Commit 693f1c9f authored by Marek Vavruša's avatar Marek Vavruša
Browse files

daemon/main: added check for dupfd

fixed CID#125374
parent 984644ed
No related branches found
No related tags found
No related merge requests found
......@@ -49,7 +49,10 @@ static void tty_read(uv_stream_t *stream, ssize_t nread, const uv_buf_t *buf)
uv_close((uv_handle_t *)stream, (uv_close_cb) free);
return;
}
out = outerr = fdopen(dup(stream_fd), "w");
uv_os_fd_t dup_fd = dup(stream_fd);
if (dup_fd >= 0) {
out = outerr = fdopen(dup(stream_fd), "w");
}
}
/* Execute */
if (stream && buf && nread > 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment