diff options
Diffstat (limited to 'readline/histfile.c')
-rw-r--r-- | readline/histfile.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/readline/histfile.c b/readline/histfile.c index fffeb3fd319..56cbbf0498c 100644 --- a/readline/histfile.c +++ b/readline/histfile.c @@ -407,7 +407,8 @@ history_truncate_file (fname, lines) truncate to. */ if (bp > buffer && ((file = open (filename, O_WRONLY|O_TRUNC|O_BINARY, 0600)) != -1)) { - write (file, bp, chars_read - (bp - buffer)); + if (write (file, bp, chars_read - (bp - buffer)) < 0) + rv = errno; #if defined (__BEOS__) /* BeOS ignores O_TRUNC. */ |