diff options
Diffstat (limited to 'client.c')
-rw-r--r-- | client.c | 11 |
1 files changed, 3 insertions, 8 deletions
@@ -45,7 +45,7 @@ client_init(char *path, struct client_ctx *cctx, int cmdflags, int flags) struct winsize ws; size_t size; int fd, fd2, mode; - char *name, *term; + char *term; char rpathbuf[MAXPATHLEN]; if (realpath(path, rpathbuf) == NULL) @@ -113,13 +113,8 @@ server_started: *data.term = '\0'; } - *data.tty = '\0'; - if ((name = ttyname(STDIN_FILENO)) == NULL) - fatal("ttyname failed"); - if (strlcpy(data.tty, name, sizeof data.tty) >= sizeof data.tty) - fatalx("ttyname failed"); - - fd2 = dup(STDIN_FILENO); + if ((fd2 = dup(STDIN_FILENO)) == -1) + fatal("dup failed"); imsg_compose(&cctx->ibuf, MSG_IDENTIFY, PROTOCOL_VERSION, -1, fd2, &data, sizeof data); } |