Skip to content

Commit ee8314b

Browse files
committed
Don't use creat(), as it makes mingw sad.
1 parent 7a7bd4b commit ee8314b

File tree

1 file changed

+5
-3
lines changed
  • plat/minix68k/cv

1 file changed

+5
-3
lines changed

plat/minix68k/cv/cv.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <unistd.h>
1717
#include <fcntl.h>
1818
#include <sys/stat.h>
19+
#include <errno.h>
1920
#include "out.h"
2021
#include "warnings.h"
2122
#include "object.h"
@@ -116,12 +117,13 @@ int main(int argc, char* argv[])
116117
switch (argc)
117118
{
118119
case 3:
119-
if ((output = creat(argv[2], 0644)) < 0)
120-
fatal("Can't write %s.\n", argv[2]);
120+
output = open(argv[2], O_CREAT|O_RDWR|O_BINARY, 0755);
121+
if (output < 0)
122+
fatal("Can't write %s: %s\n", argv[2], strerror(errno));
121123
output_file = argv[2];
122124
outputfile_created = 1;
123125
if (!rd_open(argv[1]))
124-
fatal("Can't read %s.\n", argv[1]);
126+
fatal("Can't read %s: %s\n", argv[1], strerror(errno));
125127
break;
126128
default:
127129
fatal("Usage: %s [+-= amount] <ACK object> <ST-MINIX object>.\n", argv[0]);

0 commit comments

Comments
 (0)