From: Paul Eggert Date: Sun, 20 Jul 2025 15:59:16 +0000 (-0700) Subject: insert-file-contents from seekable non-regular X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=557980512d3b4b73b5bad237d50e11de67fcf3e0;p=emacs.git insert-file-contents from seekable non-regular * src/fileio.c (Finsert_file_contents): Be more conservative when reading from seekable non-regular files when END is given. The code assumed that in this case, reads would succeed or fail quickly so there was no need to call internal_condition_case_1. However, in some cases, e.g., /dev/random, it could take a while. This fixes a glitch introduced in commit cb4579ed6ba45c81ee7ec627bf197e1def121f24 dated 2022-06-11. (cherry picked from commit aaf9c5213f7102dca8da7b6aaf1d400419eda075) --- diff --git a/src/fileio.c b/src/fileio.c index 010c5ac0864..9b47b565458 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -4897,7 +4897,7 @@ by calling `format-decode', which see. */) } bufsize = min (bufsize, total - inserted); - if (!seekable && end_offset == TYPE_MAXIMUM (off_t)) + if (!regular) { Lisp_Object nbytes; intmax_t number;