# HG changeset patch # User J. Ali Harlow # Date 1465490229 -3600 # Node ID a3e5e3eaf22420d3f76c920bdda4061dc49a85a5 # Parent 7a38fc77fbdea19010e530d92fa8b74a04c65304 Improve an error message diff -r 7a38fc77fbde -r a3e5e3eaf224 librazor/atomic-actions.c --- a/librazor/atomic-actions.c Wed Jun 08 15:15:27 2016 +0100 +++ b/librazor/atomic-actions.c Thu Jun 09 17:37:09 2016 +0100 @@ -365,9 +365,20 @@ free(newbuf); free(oldbuf); #else + int code; + const char *object; + if (rename(path, dest)) { - if (!atomic->error) - atomic->error = razor_error_new_posix(dest); + if (!atomic->error) { + code = errno; + if (access(path, F_OK) < 0) + object = path; + else + object = dest; + atomic->error = razor_error_new_str(RAZOR_POSIX_ERROR, + code, object, + strerror(code)); + } return -1; } #endif