Github user sanhex commented on a diff in the pull request:
https://github.com/apache/incubator-guacamole-server/pull/118#discussion_r145827462
--- Diff: src/terminal/terminal.c ---
@@ -413,8 +413,10 @@ guac_terminal* guac_terminal_create(guac_client*
client,
void guac_terminal_free(guac_terminal* term) {
/* Close user input pipe */
- close(term->stdin_pipe_fd[1]);
- close(term->stdin_pipe_fd[0]);
+ if (term->stdin_pipe_fd[1] != -1)
--- End diff --
Thanks for the idea. If -1 is acceptable here, maybe I should also do the
same in guac_terminal_free(). E.g.
void guac_terminal_free(guac_terminal* term) {
/* Close user input pipe */
if (term->stdin_pipe_fd[1] != -1) {
close(term->stdin_pipe_fd[1]);
term->stdin_pipe_fd[1] = -1;
}
if (term->stdin_pipe_fd[0] != -1) {
close(term->stdin_pipe_fd[0]);
term->stdin_pipe_fd[0] = -1;
}
---