diff -r 0a11e755ccda -r edd9b0fa63ca librazor/root.c --- a/librazor/root.c Fri Jan 09 16:35:09 2009 +0000 +++ b/librazor/root.c Mon Jan 12 17:54:13 2009 +0000 @@ -37,6 +37,10 @@ #include "razor.h" #include "razor-internal.h" +#ifndef O_BINARY +#define O_BINARY 0 +#endif + static const char system_repo_filename[] = "system.rzdb"; static const char system_repo_details_filename[] = "system-details.rzdb"; static const char system_repo_files_filename[] = "system-files.rzdb"; @@ -149,7 +153,8 @@ snprintf(image->new_path, sizeof image->new_path, "%s%s/%s", root, razor_root_path, next_repo_filename); image->fd = open(image->new_path, - O_CREAT | O_WRONLY | O_TRUNC | O_EXCL, 0666); + O_CREAT | O_WRONLY | O_TRUNC | O_EXCL | O_BINARY, + 0666); if (image->fd < 0) { fprintf(stderr, "failed to get lock file, " "maybe previous operation crashed?\n");