Initialize cwd fd to -1 so that we don't close fd 0 if the client is

destroyed before it is changed. Also allow ttyname() to fail. Fixes
problems when running out of file descriptors reported by Bruno Sutic.
This commit is contained in:
nicm
2015-07-13 15:49:31 +00:00
parent 81069f66f9
commit c7374c31c4
3 changed files with 11 additions and 5 deletions

2
tmux.h
View File

@ -1600,7 +1600,7 @@ void tty_putcode_ptr2(struct tty *, enum tty_code_code, const void *,
void tty_puts(struct tty *, const char *);
void tty_putc(struct tty *, u_char);
void tty_putn(struct tty *, const void *, size_t, u_int);
void tty_init(struct tty *, struct client *, int, char *);
int tty_init(struct tty *, struct client *, int, char *);
int tty_resize(struct tty *);
int tty_set_size(struct tty *, u_int, u_int);
void tty_set_class(struct tty *, u_int);