Use O_RDWR for open write mode (for mmap)
[babeltrace.git] / formats / ctf-text / ctf-text.c
index 2e9509e71cf281672f11c1a2afcbbbbfd001d8f7..cc882f60b02d64ebbe777701c50c69755bf8007b 100644 (file)
 struct trace_descriptor *ctf_text_open_trace(const char *path, int flags);
 void ctf_text_close_trace(struct trace_descriptor *descriptor);
 
-static
-rw_dispatch read_dispatch_table[] = {
-       /* All unimplemented */
-};
-
 static
 rw_dispatch write_dispatch_table[] = {
        [ CTF_TYPE_INTEGER ] = ctf_text_integer_write,
@@ -65,8 +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:
-               fp = fopen(path, "w");
+       case O_RDWR:
+               if (!path)
+                       fp = stdout;
+               else
+                       fp = fopen(path, "w");
                if (!fp)
                        goto error;
                pos->fp = fp;
This page took 0.023059 seconds and 4 git commands to generate.