diff -r a2908416b7cc -r 0a5e583393e1 librazor/atomic-emulate.c --- a/librazor/atomic-emulate.c Mon Sep 01 12:19:32 2014 +0100 +++ b/librazor/atomic-emulate.c Tue Sep 09 15:27:12 2014 +0100 @@ -244,14 +244,12 @@ abspath = absolute_path(path); if (!abspath) { - atomic->error = razor_error_new_str(path, - strerror(errno)); + atomic->error = razor_error_new_posix(path); return -1; } if (stat(abspath, &buf) < 0) { - atomic->error = razor_error_new_str(abspath, - strerror(errno)); + atomic->error = razor_error_new_posix(abspath); free(abspath); return -1; } @@ -269,8 +267,7 @@ } if (stat(abspath, &buf) < 0) { - atomic->error = - razor_error_new_str(abspath, strerror(errno)); + atomic->error = razor_error_new_posix(abspath); free(abspath); return -1; } @@ -304,8 +301,7 @@ #ifndef MSWIN_API if (stat(".", &buf) < 0) { - atomic->error = - razor_error_new_str(".", strerror(errno)); + atomic->error = razor_error_new_posix("."); free(s); free(atomic->toplevel); atomic->toplevel = NULL; @@ -329,7 +325,8 @@ } #endif - atomic->error = razor_error_new_str(atomic->toplevel, + atomic->error = razor_error_new_str(RAZOR_POSIX_ERROR, err, + atomic->toplevel, strerror(err)); free(atomic->toplevel); @@ -434,7 +431,7 @@ return 0; #else - atomic->error = razor_error_new_str(NULL, + atomic->error = razor_error_new_str(RAZOR_POSIX_ERROR, ENOSYS, NULL, "Symbolic links not supported " "on this platform"); @@ -460,7 +457,7 @@ mode & (S_IRWXU | S_IRWXG | S_IRWXO)); if (fd == -1) - atomic->error = razor_error_new_str(filename, strerror(errno)); + atomic->error = razor_error_new_posix(filename); else { a = atomic_action_new(ACTION_MOVE); a->args.path = tmpnam;