mirror of
git://git.sv.gnu.org/nano.git
synced 2025-02-10 02:14:21 +03:00
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.
This commit is contained in:
parent
2087c20a83
commit
a2b20a1915
@ -1953,8 +1953,9 @@ bool write_file(const char *name, FILE *thefile, bool tmp,
|
|||||||
|
|
||||||
unlink(tempname);
|
unlink(tempname);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
if (!S_ISFIFO(st.st_mode))
|
||||||
|
#endif
|
||||||
/* Ensure the data has reached the disk before reporting it as written. */
|
/* Ensure the data has reached the disk before reporting it as written. */
|
||||||
if (fflush(thefile) != 0 || fsync(fileno(thefile)) != 0) {
|
if (fflush(thefile) != 0 || fsync(fileno(thefile)) != 0) {
|
||||||
statusline(ALERT, _("Error writing %s: %s"), realname, strerror(errno));
|
statusline(ALERT, _("Error writing %s: %s"), realname, strerror(errno));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user