diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2015-07-14 08:15:05 +0100 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2015-07-14 08:15:05 +0100 |
commit | 5ffb869e1a543b264b9d94a19077d16f9832aff5 (patch) | |
tree | 59392329b2b678d46667e0960efa9e2c7dfb202a /tty.c | |
parent | bed3069fd746741286e624126774f98ed51fbbdf (diff) | |
parent | dcc28434f460f637976ca313e062c0728d438e97 (diff) | |
download | rtmux-5ffb869e1a543b264b9d94a19077d16f9832aff5.tar.gz rtmux-5ffb869e1a543b264b9d94a19077d16f9832aff5.tar.bz2 rtmux-5ffb869e1a543b264b9d94a19077d16f9832aff5.zip |
Merge branch 'master' of github.com:tmux/tmux
Diffstat (limited to 'tty.c')
-rw-r--r-- | tty.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -59,11 +59,14 @@ void tty_default_colours(struct grid_cell *, const struct window_pane *); #define tty_pane_full_width(tty, ctx) \ ((ctx)->xoff == 0 && screen_size_x((ctx)->wp->screen) >= (tty)->sx) -void +int tty_init(struct tty *tty, struct client *c, int fd, char *term) { char *path; + if (!isatty(fd)) + return (-1); + memset(tty, 0, sizeof *tty); tty->log_fd = -1; @@ -75,13 +78,15 @@ tty_init(struct tty *tty, struct client *c, int fd, char *term) tty->client = c; if ((path = ttyname(fd)) == NULL) - fatalx("ttyname failed"); + return (-1); tty->path = xstrdup(path); tty->cstyle = 0; tty->ccolour = xstrdup(""); tty->flags = 0; tty->term_flags = 0; + + return (0); } int |