[BACK]Return to tty.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tmux

Diff for /src/usr.bin/tmux/tty.c between version 1.20 and 1.21

version 1.20, 2009/08/11 19:32:25 version 1.21, 2009/08/11 20:29:05
Line 80 
Line 80 
                 tty->log_fd = -1;                  tty->log_fd = -1;
   
         tty->term = tty_term_find(tty->termname, tty->fd, overrides, cause);          tty->term = tty_term_find(tty->termname, tty->fd, overrides, cause);
         if (tty->term == NULL)          if (tty->term == NULL) {
                 goto error;                  tty_close(tty);
                   return (-1);
           }
           tty->flags |= TTY_OPENED;
   
         tty->in = buffer_create(BUFSIZ);          tty->in = buffer_create(BUFSIZ);
         tty->out = buffer_create(BUFSIZ);          tty->out = buffer_create(BUFSIZ);
Line 95 
Line 98 
         tty_fill_acs(tty);          tty_fill_acs(tty);
   
         return (0);          return (0);
   
 error:  
         close(tty->fd);  
         tty->fd = -1;  
   
         return (-1);  
 }  }
   
 void  void
Line 289 
Line 286 
 void  void
 tty_close(struct tty *tty)  tty_close(struct tty *tty)
 {  {
         if (tty->fd == -1)  
                 return;  
   
         if (tty->log_fd != -1) {          if (tty->log_fd != -1) {
                 close(tty->log_fd);                  close(tty->log_fd);
                 tty->log_fd = -1;                  tty->log_fd = -1;
Line 299 
Line 293 
   
         tty_stop_tty(tty);          tty_stop_tty(tty);
   
         tty_term_free(tty->term);          if (tty->flags & TTY_OPENED) {
         tty_keys_free(tty);                  tty_term_free(tty->term);
                   tty_keys_free(tty);
   
         close(tty->fd);                  buffer_destroy(tty->in);
         tty->fd = -1;                  buffer_destroy(tty->out);
   
         buffer_destroy(tty->in);                  tty->flags &= ~TTY_OPENED;
         buffer_destroy(tty->out);          }
   
           if (tty->fd != -1) {
                   close(tty->fd);
                   tty->fd = -1;
           }
 }  }
   
 void  void

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21