mirror of
https://github.com/ksherlock/wdc-utils.git
synced 2025-01-19 23:31:04 +00:00
O_BINARY flag.
This commit is contained in:
parent
337840cb3c
commit
09628cb2c3
7
omf.cpp
7
omf.cpp
@ -9,6 +9,11 @@
|
|||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <sysexits.h>
|
#include <sysexits.h>
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef O_BINARY
|
||||||
|
#define O_BINARY 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#pragma pack(push, 1)
|
#pragma pack(push, 1)
|
||||||
struct omf_header {
|
struct omf_header {
|
||||||
uint32_t bytecount = 0;
|
uint32_t bytecount = 0;
|
||||||
@ -70,7 +75,7 @@ void save_omf(std::vector<omf::segment> &segments, bool expressload, const std::
|
|||||||
}
|
}
|
||||||
|
|
||||||
int fd;
|
int fd;
|
||||||
fd = open(path.c_str(), O_WRONLY | O_CREAT | O_TRUNC, 0666);
|
fd = open(path.c_str(), O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
err(EX_CANTCREAT, "Unable to open %s", path.c_str());
|
err(EX_CANTCREAT, "Unable to open %s", path.c_str());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user