[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.21 and 1.22

version 1.21, 2009/08/11 20:29:05 version 1.22, 2009/08/11 21:28:11
Line 45 
Line 45 
             const struct grid_cell *, const struct grid_utf8 *);              const struct grid_cell *, const struct grid_utf8 *);
   
 void  void
 tty_init(struct tty *tty, char *path, char *term)  tty_init(struct tty *tty, int fd, char *path, char *term)
 {  {
         tty->path = xstrdup(path);          tty->path = xstrdup(path);
           tty->fd = fd;
   
         if (term == NULL || *term == '\0')          if (term == NULL || *term == '\0')
                 tty->termname = xstrdup("unknown");                  tty->termname = xstrdup("unknown");
         else          else
Line 59 
Line 61 
 int  int
 tty_open(struct tty *tty, const char *overrides, char **cause)  tty_open(struct tty *tty, const char *overrides, char **cause)
 {  {
         int              mode;          int     mode;
   
         tty->fd = open(tty->path, O_RDWR|O_NONBLOCK);  
         if (tty->fd == -1) {          if (tty->fd == -1) {
                 xasprintf(cause, "%s: %s", tty->path, strerror(errno));                  tty->fd = open(tty->path, O_RDWR|O_NONBLOCK);
                 return (-1);                  if (tty->fd == -1) {
                           xasprintf(cause, "%s: %s", tty->path, strerror(errno));
                           return (-1);
                   }
         }          }
   
         if ((mode = fcntl(tty->fd, F_GETFL)) == -1)          if ((mode = fcntl(tty->fd, F_GETFL)) == -1)

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