Equipped all non-system-dependent open(2) calls with O_BINARY

This commit is contained in:
2014-11-26 16:42:56 +00:00
parent ad688b85eb
commit 0b110821f6
12 changed files with 85 additions and 29 deletions

View File

@@ -26,6 +26,12 @@
#include <pthread.h>
#include <errno.h>
#include <fcntl.h>
/* ts B41126 : O_BINARY is needed for Cygwin but undefined elsewhere */
#ifndef O_BINARY
#define O_BINARY 0
#endif
#include "libburn.h"
#include "init.h"
#include "drive.h"
@@ -1638,17 +1644,17 @@ static int burn_role_by_access(char *fname, int flag)
#endif
int fd;
fd = open(fname, O_RDWR | O_LARGEFILE);
fd = open(fname, O_RDWR | O_LARGEFILE | O_BINARY);
if (fd != -1) {
close(fd);
return 2;
}
fd = open(fname, O_RDONLY | O_LARGEFILE);
fd = open(fname, O_RDONLY | O_LARGEFILE | O_BINARY);
if (fd != -1) {
close(fd);
return 4;
}
fd = open(fname, O_WRONLY | O_LARGEFILE);
fd = open(fname, O_WRONLY | O_LARGEFILE | O_BINARY);
if (fd != -1) {
close(fd);
return 5;