files: give feedback while waiting for a FIFO to open up
Этот коммит содержится в:
родитель
1b2018e921
Коммит
afbaf8ae2d
10
src/files.c
10
src/files.c
@ -968,6 +968,9 @@ int open_file(const char *filename, bool newfie, bool quiet, FILE **f)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (S_ISFIFO(fileinfo.st_mode))
|
||||||
|
statusbar(_("Reading from FIFO..."));
|
||||||
|
|
||||||
/* Try opening the file. */
|
/* Try opening the file. */
|
||||||
fd = open(full_filename, O_RDONLY);
|
fd = open(full_filename, O_RDONLY);
|
||||||
|
|
||||||
@ -981,7 +984,7 @@ int open_file(const char *filename, bool newfie, bool quiet, FILE **f)
|
|||||||
statusline(ALERT, _("Error reading %s: %s"), filename, strerror(errno));
|
statusline(ALERT, _("Error reading %s: %s"), filename, strerror(errno));
|
||||||
close(fd);
|
close(fd);
|
||||||
} else if (!inhelp)
|
} else if (!inhelp)
|
||||||
statusbar(_("Reading File"));
|
statusbar(_("Reading..."));
|
||||||
}
|
}
|
||||||
|
|
||||||
free(full_filename);
|
free(full_filename);
|
||||||
@ -1824,6 +1827,9 @@ bool write_file(const char *name, FILE *f_open, bool tmp,
|
|||||||
}
|
}
|
||||||
#endif /* !NANO_TINY */
|
#endif /* !NANO_TINY */
|
||||||
|
|
||||||
|
if (stat(realname, &st) == 0 && S_ISFIFO(st.st_mode))
|
||||||
|
statusbar(_("Writing to FIFO..."));
|
||||||
|
|
||||||
if (f_open == NULL) {
|
if (f_open == NULL) {
|
||||||
/* Now open the file in place. Use O_EXCL if tmp is TRUE. This
|
/* Now open the file in place. Use O_EXCL if tmp is TRUE. This
|
||||||
* is copied from joe, because wiggy says so *shrug*. */
|
* is copied from joe, because wiggy says so *shrug*. */
|
||||||
@ -1853,6 +1859,8 @@ bool write_file(const char *name, FILE *f_open, bool tmp,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
statusbar(_("Writing..."));
|
||||||
|
|
||||||
while (fileptr != NULL) {
|
while (fileptr != NULL) {
|
||||||
size_t data_len = strlen(fileptr->data), size;
|
size_t data_len = strlen(fileptr->data), size;
|
||||||
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user