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

Diff for /src/usr.bin/tmux/server-client.c between version 1.338 and 1.339

version 1.338, 2020/05/16 15:47:22 version 1.339, 2020/05/16 16:07:55
Line 238 
Line 238 
 int  int
 server_client_open(struct client *c, char **cause)  server_client_open(struct client *c, char **cause)
 {  {
           const char      *ttynam = _PATH_TTY;
   
         if (c->flags & CLIENT_CONTROL)          if (c->flags & CLIENT_CONTROL)
                 return (0);                  return (0);
   
         if (strcmp(c->ttyname, "/dev/tty") == 0) {          if (strcmp(c->ttyname, ttynam) == 0||
                 *cause = xstrdup("can't use /dev/tty");              ((isatty(STDIN_FILENO) &&
               (ttynam = ttyname(STDIN_FILENO)) != NULL &&
               strcmp(c->ttyname, ttynam) == 0) ||
               (isatty(STDOUT_FILENO) &&
               (ttynam = ttyname(STDOUT_FILENO)) != NULL &&
               strcmp(c->ttyname, ttynam) == 0) ||
               (isatty(STDERR_FILENO) &&
               (ttynam = ttyname(STDERR_FILENO)) != NULL &&
               strcmp(c->ttyname, ttynam) == 0))) {
                   xasprintf(cause, "can't use %s", c->ttyname);
                 return (-1);                  return (-1);
         }          }
   

Legend:
Removed from v.1.338  
changed lines
  Added in v.1.339