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 4a9f4362fe
commit 33fee4725c
12 changed files with 85 additions and 29 deletions

View File

@ -1,7 +1,7 @@
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
Copyright (c) 2006 - 2012 Thomas Schmitt <scdbackup@gmx.net>
Copyright (c) 2006 - 2014 Thomas Schmitt <scdbackup@gmx.net>
Provided under GPL version 2 or later.
*/
@ -22,6 +22,11 @@
#include <fcntl.h>
#include <errno.h>
/* ts B41126 : O_BINARY is needed for Cygwin but undefined elsewhere */
#ifndef O_BINARY
#define O_BINARY 0
#endif
#include "sector.h"
#include "libburn.h"
#include "drive.h"
@ -521,7 +526,8 @@ int burn_read_data(struct burn_drive *d, off_t byte_address,
fd = d->stdio_fd;
if (fd < 0)
d->stdio_fd = fd =
open(d->devname, O_RDONLY | O_LARGEFILE);
open(d->devname,
O_RDONLY | O_LARGEFILE | O_BINARY);
if (fd == -1) {
if (errno == EACCES && (flag & 2)) {
if (!(flag & 8))