mirror of
git://git.sv.gnu.org/nano.git
synced 2025-02-03 15:07:40 +03:00
files: prepending to a fifo makes no sense, so do not try that
Trying to prepend would hang nano until some other process writes something to the fifo. This fixes https://savannah.gnu.org/bugs/?61236. Bug existed since before version 2.2.4.
This commit is contained in:
parent
bb3d367716
commit
9ab49658d7
@ -1799,6 +1799,11 @@ bool write_file(const char *name, FILE *thefile, bool tmp,
|
||||
goto cleanup_and_exit;
|
||||
}
|
||||
|
||||
if (method == PREPEND && is_existing_file && S_ISFIFO(st.st_mode)) {
|
||||
statusline(ALERT, _("Error writing %s: %s"), realname, "FIFO");
|
||||
goto cleanup_and_exit;
|
||||
}
|
||||
|
||||
/* When prepending, first copy the existing file to a temporary file. */
|
||||
if (method == PREPEND) {
|
||||
FILE *source = fopen(realname, "rb");
|
||||
|
Loading…
x
Reference in New Issue
Block a user