Skip to content

Commit

Permalink
Don't use creat(), as it makes mingw sad.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgiven committed Jan 11, 2025
1 parent 7a7bd4b commit ee8314b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions plat/minix68k/cv/cv.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <errno.h>
#include "out.h"
#include "warnings.h"
#include "object.h"
Expand Down Expand Up @@ -116,12 +117,13 @@ int main(int argc, char* argv[])
switch (argc)
{
case 3:
if ((output = creat(argv[2], 0644)) < 0)
fatal("Can't write %s.\n", argv[2]);
output = open(argv[2], O_CREAT|O_RDWR|O_BINARY, 0755);
if (output < 0)
fatal("Can't write %s: %s\n", argv[2], strerror(errno));
output_file = argv[2];
outputfile_created = 1;
if (!rd_open(argv[1]))
fatal("Can't read %s.\n", argv[1]);
fatal("Can't read %s: %s\n", argv[1], strerror(errno));
break;
default:
fatal("Usage: %s [+-= amount] <ACK object> <ST-MINIX object>.\n", argv[0]);
Expand Down

0 comments on commit ee8314b

Please sign in to comment.