librazor/atomic-emulate.c
changeset 448 8476d35b048f
parent 444 a2908416b7cc
child 449 f3baf790a815
     1.1 --- a/librazor/atomic-emulate.c	Mon Sep 01 12:19:32 2014 +0100
     1.2 +++ b/librazor/atomic-emulate.c	Thu Sep 11 18:54:16 2014 +0100
     1.3 @@ -244,14 +244,12 @@
     1.4  
     1.5  		abspath = absolute_path(path);
     1.6  		if (!abspath) {
     1.7 -			atomic->error = razor_error_new_str(path,
     1.8 -							    strerror(errno));
     1.9 +			atomic->error = razor_error_new_posix(path);
    1.10  			return -1;
    1.11  		}
    1.12  
    1.13  		if (stat(abspath, &buf) < 0) {
    1.14 -			atomic->error = razor_error_new_str(abspath,
    1.15 -							    strerror(errno));
    1.16 +			atomic->error = razor_error_new_posix(abspath);
    1.17  			free(abspath);
    1.18  			return -1;
    1.19  		}
    1.20 @@ -269,8 +267,7 @@
    1.21  			}
    1.22  
    1.23  			if (stat(abspath, &buf) < 0) {
    1.24 -				atomic->error =
    1.25 -				  razor_error_new_str(abspath, strerror(errno));
    1.26 +				atomic->error = razor_error_new_posix(abspath);
    1.27  				free(abspath);
    1.28  				return -1;
    1.29  			}
    1.30 @@ -304,8 +301,7 @@
    1.31  
    1.32  #ifndef MSWIN_API
    1.33  			if (stat(".", &buf) < 0) {
    1.34 -				atomic->error =
    1.35 -				  razor_error_new_str(".", strerror(errno));
    1.36 +				atomic->error = razor_error_new_posix(".");
    1.37  				free(s);
    1.38  				free(atomic->toplevel);
    1.39  				atomic->toplevel = NULL;
    1.40 @@ -329,7 +325,8 @@
    1.41  		}
    1.42  #endif
    1.43  
    1.44 -		atomic->error = razor_error_new_str(atomic->toplevel,
    1.45 +		atomic->error = razor_error_new_str(RAZOR_POSIX_ERROR, err,
    1.46 +						    atomic->toplevel,
    1.47  						    strerror(err));
    1.48  
    1.49  		free(atomic->toplevel);
    1.50 @@ -434,7 +431,7 @@
    1.51  
    1.52  	return 0;
    1.53  #else
    1.54 -	atomic->error = razor_error_new_str(NULL,
    1.55 +	atomic->error = razor_error_new_str(RAZOR_POSIX_ERROR, ENOSYS, NULL,
    1.56  					    "Symbolic links not supported "
    1.57  					    "on this platform");
    1.58  
    1.59 @@ -460,7 +457,7 @@
    1.60  		  mode & (S_IRWXU | S_IRWXG | S_IRWXO));
    1.61  
    1.62  	if (fd == -1)
    1.63 -		atomic->error = razor_error_new_str(filename, strerror(errno));
    1.64 +		atomic->error = razor_error_new_posix(filename);
    1.65  	else {
    1.66  		a = atomic_action_new(ACTION_MOVE);
    1.67  		a->args.path = tmpnam;