lib: Reset libbabeltrace2 to SONANE 0
[babeltrace.git] / include / babeltrace / compat / memstream-internal.h
index b7ae97e86cc89d3d680afe21dfa8b857be7b44b4..fa7514d01c1e9652563bcef536e5df67e8816cae 100644 (file)
@@ -2,8 +2,6 @@
 #define _BABELTRACE_FORMAT_CTF_MEMSTREAM_H
 
 /*
- * format/ctf/memstream.h
- *
  * Copyright 2012 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  *
  * memstream compatibility layer.
@@ -38,6 +36,7 @@ FILE *bt_fmemopen(void *buf, size_t size, const char *mode)
 
 #else /* BABELTRACE_HAVE_FMEMOPEN */
 
+#include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -139,7 +138,7 @@ FILE *bt_fmemopen(void *buf, size_t size, const char *mode)
        /*
         * We need to write to the file.
         */
-       fp = fdopen(ret, "w+");
+       fp = fdopen(ret, "wb+");
        if (!fp) {
                goto error_unlink;
        }
@@ -262,7 +261,7 @@ FILE *bt_open_memstream(char **ptr, size_t *sizeloc)
                g_free(tmpname);
                return NULL;
        }
-       fp = fdopen(ret, "w+");
+       fp = fdopen(ret, "wb+");
        if (!fp) {
                goto error_unlink;
        }
This page took 0.025213 seconds and 4 git commands to generate.