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.
Этот коммит содержится в:
родитель
2087c20a83
Коммит
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));
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user