Github user ceharris commented on a diff in the pull request:

    
https://github.com/apache/incubator-guacamole-server/pull/118#discussion_r145800076
  
    --- 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 --
    
    `fstat()` is used get a `struct stat` for a file on a filesystem; it isn't 
of much use with pipe/socket descriptors.
    
    Without weighing in on whether it makes sense to move the calls to `close`, 
I'd say the use of -1 to mark an unused/closed descriptor field is fairly 
idiomatic C. 


---

Reply via email to