From: Eli Zaretskii Date: Sat, 7 Nov 2020 09:19:44 +0000 (+0200) Subject: Fix 'send-string-to-terminal' writing very long strings X-Git-Tag: emacs-27.1.90~73 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d4242177daaee9078245570125c5a99e65f55163;p=emacs.git 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) --- 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; }