added missing open flags and mode in init_logger
authorJohn Tsiombikas <nuclear@mutantstargoat.com>
Tue, 4 Oct 2016 05:09:09 +0000 (08:09 +0300)
committerJohn Tsiombikas <nuclear@mutantstargoat.com>
Tue, 4 Oct 2016 05:09:09 +0000 (08:09 +0300)
src/dos/logger.c

index f7e9256..70489ad 100644 (file)
@@ -8,7 +8,7 @@
 int init_logger(const char *fname)
 {
        int fd;
-       if((fd = open(fname, O_WRONLY)) == -1) {
+       if((fd = open(fname, O_CREAT | O_WRONLY | O_TRUNC, 0644)) == -1) {
                fprintf(stderr, "init_logger: failed to open %s: %s\n", fname, strerror(errno));
                return -1;
        }