File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 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 ]);
You can’t perform that action at this time.
0 commit comments