librazor/root.c
changeset 345 edd9b0fa63ca
parent 341 0a11e755ccda
child 346 765b72a613b2
     1.1 --- a/librazor/root.c	Fri Jan 09 16:35:09 2009 +0000
     1.2 +++ b/librazor/root.c	Mon Jan 12 17:54:13 2009 +0000
     1.3 @@ -37,6 +37,10 @@
     1.4  #include "razor.h"
     1.5  #include "razor-internal.h"
     1.6  
     1.7 +#ifndef O_BINARY
     1.8 +#define O_BINARY	0
     1.9 +#endif
    1.10 +
    1.11  static const char system_repo_filename[] = "system.rzdb";
    1.12  static const char system_repo_details_filename[] = "system-details.rzdb";
    1.13  static const char system_repo_files_filename[] = "system-files.rzdb";
    1.14 @@ -149,7 +153,8 @@
    1.15  	snprintf(image->new_path, sizeof image->new_path,
    1.16  		 "%s%s/%s", root, razor_root_path, next_repo_filename);
    1.17  	image->fd = open(image->new_path,
    1.18 -			 O_CREAT | O_WRONLY | O_TRUNC | O_EXCL, 0666);
    1.19 +			 O_CREAT | O_WRONLY | O_TRUNC | O_EXCL | O_BINARY,
    1.20 +			 0666);
    1.21  	if (image->fd < 0) {
    1.22  		fprintf(stderr, "failed to get lock file, "
    1.23  			"maybe previous operation crashed?\n");