history: don't send error messages to the screen; store them in the queue
parent
2d204bcbfd
commit
b9e3e4edb8
|
@ -358,8 +358,7 @@ void save_history(void)
|
||||||
hisfile = fopen(histname, "wb");
|
hisfile = fopen(histname, "wb");
|
||||||
|
|
||||||
if (hisfile == NULL)
|
if (hisfile == NULL)
|
||||||
fprintf(stderr, _("Error writing %s: %s\n"), histname,
|
jot_error(N_("Error writing %s: %s\n"), histname, strerror(errno));
|
||||||
strerror(errno));
|
|
||||||
else {
|
else {
|
||||||
/* Don't allow others to read or write the history file. */
|
/* Don't allow others to read or write the history file. */
|
||||||
chmod(histname, S_IRUSR | S_IWUSR);
|
chmod(histname, S_IRUSR | S_IWUSR);
|
||||||
|
@ -367,8 +366,7 @@ void save_history(void)
|
||||||
if (!write_list(searchtop, hisfile) ||
|
if (!write_list(searchtop, hisfile) ||
|
||||||
!write_list(replacetop, hisfile) ||
|
!write_list(replacetop, hisfile) ||
|
||||||
!write_list(executetop, hisfile))
|
!write_list(executetop, hisfile))
|
||||||
fprintf(stderr, _("Error writing %s: %s\n"), histname,
|
jot_error(N_("Error writing %s: %s\n"), histname, strerror(errno));
|
||||||
strerror(errno));
|
|
||||||
|
|
||||||
fclose(hisfile);
|
fclose(hisfile);
|
||||||
}
|
}
|
||||||
|
@ -449,7 +447,7 @@ void save_poshistory(void)
|
||||||
FILE *hisfile = fopen(poshistname, "wb");
|
FILE *hisfile = fopen(poshistname, "wb");
|
||||||
|
|
||||||
if (hisfile == NULL)
|
if (hisfile == NULL)
|
||||||
fprintf(stderr, _("Error writing %s: %s\n"), poshistname, strerror(errno));
|
jot_error(N_("Error writing %s: %s\n"), poshistname, strerror(errno));
|
||||||
else {
|
else {
|
||||||
/* Don't allow others to read or write the history file. */
|
/* Don't allow others to read or write the history file. */
|
||||||
chmod(poshistname, S_IRUSR | S_IWUSR);
|
chmod(poshistname, S_IRUSR | S_IWUSR);
|
||||||
|
@ -471,8 +469,7 @@ void save_poshistory(void)
|
||||||
path_and_place[length - 1] = '\n';
|
path_and_place[length - 1] = '\n';
|
||||||
|
|
||||||
if (fwrite(path_and_place, sizeof(char), length, hisfile) < length)
|
if (fwrite(path_and_place, sizeof(char), length, hisfile) < length)
|
||||||
fprintf(stderr, _("Error writing %s: %s\n"),
|
jot_error(N_("Error writing %s: %s\n"), poshistname, strerror(errno));
|
||||||
poshistname, strerror(errno));
|
|
||||||
free(path_and_place);
|
free(path_and_place);
|
||||||
}
|
}
|
||||||
fclose(hisfile);
|
fclose(hisfile);
|
||||||
|
|
Loading…
Reference in New Issue