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

This commit is contained in:
2014-11-26 16:47:40 +00:00
parent 28b6533856
commit a47b59791e
8 changed files with 54 additions and 20 deletions

View File

@ -28,6 +28,11 @@
#include <fcntl.h>
#include <utime.h>
/* O_BINARY is needed for Cygwin but undefined elsewhere */
#ifndef O_BINARY
#define O_BINARY 0
#endif
#include "lib_mgt.h"
#include "drive_mgt.h"
@ -561,7 +566,7 @@ int Xorriso_tree_restore_node(struct XorrisO *xorriso, IsoNode *node,
open_flags= O_WRONLY|O_CREAT;
if(disk_offset==0 || !(flag&2))
open_flags|= O_EXCL;
write_fd= open(open_path_pt, open_flags, S_IRUSR|S_IWUSR);
write_fd= open(open_path_pt, open_flags | O_BINARY, S_IRUSR | S_IWUSR);
l_errno= errno;
if(write_fd == -1 && errno == EACCES && (flag & 128))
{ret= 4; goto ex;}