mirror of git://git.sv.gnu.org/nano.git
files: exclude the call of fsync() from the tiny version
To avoid a spurious error message when the user chooses to write the current buffer to a fifo. Reported-by: André Kugland <kugland@gmail.com> https://lists.gnu.org/archive/html/nano-devel/2021-09/msg00031.html
This commit is contained in:
parent
9ab49658d7
commit
b07fb5a811
|
@ -1961,13 +1961,13 @@ bool write_file(const char *name, FILE *thefile, bool tmp,
|
|||
}
|
||||
|
||||
if (!is_existing_file || !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));
|
||||
fclose(thefile);
|
||||
goto cleanup_and_exit;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (fclose(thefile) != 0) {
|
||||
statusline(ALERT, _("Error writing %s: %s"), realname, strerror(errno));
|
||||
|
|
Loading…
Reference in New Issue