Skip to content

Commit

Permalink
O_BINARY only exists on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgiven committed Jan 11, 2025
1 parent ee8314b commit 64836c7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plat/minix68k/cv/cv.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,15 @@
#include <fcntl.h>
#include <sys/stat.h>
#include <errno.h>
#include <string.h>
#include "out.h"
#include "warnings.h"
#include "object.h"

#if !defined O_BINARY
#define O_BINARY 0
#endif

struct outhead outhead;
struct outsect outsect[S_MAX];

Expand Down Expand Up @@ -117,7 +122,7 @@ int main(int argc, char* argv[])
switch (argc)
{
case 3:
output = open(argv[2], O_CREAT|O_RDWR|O_BINARY, 0755);
output = open(argv[2], O_CREAT|O_RDWR|O_TRUNC|O_BINARY, 0755);
if (output < 0)
fatal("Can't write %s: %s\n", argv[2], strerror(errno));
output_file = argv[2];
Expand Down

0 comments on commit 64836c7

Please sign in to comment.