From 2fe72effa9870ee2d66aad56ce048960f933c96c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 5 Feb 2025 11:39:06 +0100 Subject: [PATCH] term: ptmx pause/resume: don't modify the FDM if ptmx has been closed This fixes error message spam when resizing a terminal window executed with --hold, and where the client application has terminated. --- terminal.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/terminal.c b/terminal.c index 6936ff29..9fd20002 100644 --- a/terminal.c +++ b/terminal.c @@ -387,12 +387,16 @@ fdm_ptmx(struct fdm *fdm, int fd, int events, void *data) bool term_ptmx_pause(struct terminal *term) { + if (term->ptmx < 0) + return false; return fdm_event_del(term->fdm, term->ptmx, EPOLLIN); } bool term_ptmx_resume(struct terminal *term) { + if (term->ptmx < 0) + return false; return fdm_event_add(term->fdm, term->ptmx, EPOLLIN); }