render: resize: don't try to signal TIOCSWINSZ on a closed ptmx FD

This commit is contained in:
Daniel Eklöf 2020-05-27 18:23:35 +02:00
parent 5639082113
commit 8fd7c837f7
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -1844,7 +1844,7 @@ maybe_resize(struct terminal *term, int width, int height, bool force)
term->margins.left, term->margins.right, term->margins.top, term->margins.bottom);
/* Signal TIOCSWINSZ */
if (ioctl(term->ptmx, TIOCSWINSZ,
if (term->ptmx >= 0 && ioctl(term->ptmx, TIOCSWINSZ,
&(struct winsize){
.ws_row = term->rows,
.ws_col = term->cols,