From bb3d367716561ad6cfa5e6599ce5ac6a8e33ac15 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Tue, 28 Sep 2021 09:40:03 +0200 Subject: [PATCH] files: making a backup of a fifo makes no sense, so do not try that This fixes https://savannah.gnu.org/bugs/?61235. Bug existed since version 4.3, commit 1b2018e9, since opening a fifo was made possible again. --- src/files.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/files.c b/src/files.c index 9cae4f85..c951559a 100644 --- a/src/files.c +++ b/src/files.c @@ -1792,6 +1792,7 @@ bool write_file(const char *name, FILE *thefile, bool tmp, * isn't temporary AND the file has not been modified by someone else since * we opened it (or we are appending/prepending or writing a selection). */ if (ISSET(MAKE_BACKUP) && is_existing_file && openfile->statinfo && + !S_ISFIFO(st.st_mode) && (openfile->statinfo->st_mtime == st.st_mtime || method != OVERWRITE || openfile->mark)) { if (!make_backup_of(realname))