nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit a2b20a19152b764b099a32392110b927a28f4292
parent 2087c20a83c87a1861b2858d6d0d3e1623223f5c
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Mon, 27 Sep 2021 17:15:57 +0200

files: do not call fsync() on a fifo, to avoid a spurious error message

This fixes https://savannah.gnu.org/bugs/?61234.

The original report was in:
  https://lists.gnu.org/archive/html/nano-devel/2021-09/msg00029.html
Reported-by: André Kugland <kugland@gmail.com>

Bug existed since version 5.0, commit a84cdaaa.

Diffstat:
Msrc/files.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/files.c b/src/files.c @@ -1953,8 +1953,9 @@ bool write_file(const char *name, FILE *thefile, bool tmp, unlink(tempname); } -#endif + if (!S_ISFIFO(st.st_mode)) +#endif /* Ensure the data has reached the disk before reporting it as written. */ if (fflush(thefile) != 0 || fsync(fileno(thefile)) != 0) { statusline(ALERT, _("Error writing %s: %s"), realname, strerror(errno));