Use O_RDWR for open write mode (for mmap)
[babeltrace.git] / formats / ctf-text / ctf-text.c
index aabf6283295010ceac69bbd7a26301935afb7e4d..cc882f60b02d64ebbe777701c50c69755bf8007b 100644 (file)
@@ -60,10 +60,11 @@ struct trace_descriptor *ctf_text_open_trace(const char *path, int flags)
        pos = g_new0(struct ctf_text_stream_pos, 1);
 
        switch (flags & O_ACCMODE) {
-       case O_WRONLY:
+       case O_RDWR:
                if (!path)
-                       path = "/dev/stdout";
-               fp = fopen(path, "w");
+                       fp = stdout;
+               else
+                       fp = fopen(path, "w");
                if (!fp)
                        goto error;
                pos->fp = fp;
This page took 0.02264 seconds and 4 git commands to generate.