#include <string.h>
#include <errno.h>
#include <stdio.h>
+#include <sys/stat.h>
#include <data/file-name.h>
#include <data/make-file.h>
}
/* Create file by that name. */
- fd = open (rf->tmp_name, O_WRONLY | O_CREAT | O_EXCL, permissions);
+ fd = open (rf->tmp_name, O_WRONLY | O_CREAT | O_EXCL | O_BINARY, permissions);
if (fd >= 0)
break;
if (errno != EEXIST)