diff options
Diffstat (limited to 'src/history.cpp')
-rw-r--r-- | src/history.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/history.cpp b/src/history.cpp index 022524c3..75e42638 100644 --- a/src/history.cpp +++ b/src/history.cpp @@ -1453,16 +1453,19 @@ bool history_t::save_internal_via_rewrite() if (wstat(new_name, &sbuf) >= 0) { /* Success */ - if (0 > fchown(out_fd, sbuf.st_uid, sbuf.st_gid)) + if (fchown(out_fd, sbuf.st_uid, sbuf.st_gid) == -1) { - debug(2, L"Error when changing ownership of history file"); + debug(2, L"Error %d when changing ownership of history file", errno); + } + if (fchmod(out_fd, sbuf.st_mode) == -1) + { + debug(2, L"Error %d when changing mode of history file", errno); } - fchmod(out_fd, sbuf.st_mode); } - if (0 > wrename(tmp_name, new_name)) + if (wrename(tmp_name, new_name) == -1) { - debug(2, L"Error when renaming history file"); + debug(2, L"Error %d when renaming history file", errno); } } close(out_fd); |