[4/4] problems restoring the history file are not signaled correctly to the calling application

Message ID 20200614201623.11743-5-tom@tromey.com
State New
Headers show
Series
  • Import readline 8.0 patches
Related show

Commit Message

Tom Tromey June 14, 2020, 8:16 p.m.
From: Chet Ramey <chet.ramey@case.edu>


---
 readline/readline/histfile.c | 2 ++
 readline/readline/patchlevel | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

-- 
2.17.2

Patch

diff --git a/readline/readline/histfile.c b/readline/readline/histfile.c
index 6c3adc9bd8d..8eb34966875 100644
--- a/readline/readline/histfile.c
+++ b/readline/readline/histfile.c
@@ -620,6 +620,7 @@  history_truncate_file (const char *fname, int lines)
 
   if (rv != 0)
     {
+      rv = errno;
       if (tempname)
 	unlink (tempname);
       history_lines_written_to_file = 0;
@@ -767,6 +768,7 @@  mmap_error:
 
   if (rv != 0)
     {
+      rv = errno;
       if (tempname)
 	unlink (tempname);
       history_lines_written_to_file = 0;
diff --git a/readline/readline/patchlevel b/readline/readline/patchlevel
index ce3e3556533..626a945e08f 100644
--- a/readline/readline/patchlevel
+++ b/readline/readline/patchlevel
@@ -1,3 +1,3 @@ 
 # Do not edit -- exists only for use by patch
 
-3
+4