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.
This commit is contained in:
Benno Schulenberg 2021-09-28 09:40:03 +02:00
parent 26c0a7962e
commit bb3d367716
1 changed files with 1 additions and 0 deletions

View File

@ -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))