diff options
author | Eli Zaretskii <eliz@gnu.org> | 2020-11-07 11:19:44 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2020-11-07 11:19:44 +0200 |
commit | d4242177daaee9078245570125c5a99e65f55163 (patch) | |
tree | 33e0f4c8622fa0465f363a50359e2bbbb4f517ad /src | |
parent | 9da0f4026c62ac917e84780a27a00eefc0f1c0c6 (diff) | |
download | emacs-d4242177daaee9078245570125c5a99e65f55163.tar.gz |
Fix 'send-string-to-terminal' writing very long strings
* src/dispnew.c (Fsend_string_to_terminal): Prevent partial writes
by blocking SIGIO while 'fwrite' runs. (Bug#44320)
Diffstat (limited to 'src')
-rw-r--r-- | src/dispnew.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/dispnew.c b/src/dispnew.c index 5b6fa51a563..df55b32c718 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -5904,8 +5904,12 @@ when TERMINAL is nil. */) } out = tty->output; } + /* STRING might be very long, in which case fwrite could be + interrupted by SIGIO. So we temporarily block SIGIO. */ + unrequest_sigio (); fwrite (SDATA (string), 1, SBYTES (string), out); fflush (out); + request_sigio (); unblock_input (); return Qnil; } |