aboutsummaryrefslogtreecommitdiff
path: root/terminal.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2025-02-05 10:39:06 +0000
committerDaniel Eklöf <daniel@ekloef.se>2025-02-05 10:39:06 +0000
commit2fe72effa9870ee2d66aad56ce048960f933c96c (patch)
treeb4b811bb1601c0c51a1c39eb0607660f22c4c97f /terminal.c
parentRevert "forgejo: server/standalone: what happens when we set required=true?" (diff)
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.
Diffstat (limited to 'terminal.c')
-rw-r--r--terminal.c4
1 files changed, 4 insertions, 0 deletions
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);
}