diff -r 159067260aad -r edd9b0fa63ca librazor/rpm.c --- a/librazor/rpm.c Fri Jan 09 12:32:57 2009 +0000 +++ b/librazor/rpm.c Mon Jan 12 17:54:13 2009 +0000 @@ -44,6 +44,10 @@ #include "razor.h" #include "razor-internal.h" +#ifndef O_BINARY +#define O_BINARY 0 +#endif + #define RPM_LEAD_SIZE 96 enum { @@ -509,7 +513,8 @@ switch (mode >> 12) { case REG: /* FIXME: handle the case where a file is already there. */ - fd = open(buffer, O_WRONLY | O_CREAT | O_TRUNC, mode & 0x1ff); + fd = open(buffer, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, + mode & 0x1ff); if (fd < 0){ fprintf(stderr, "failed to create file %s\n", buffer); return -1;