]> sigrok.org Git - libsigrok.git/blobdiff - src/output/srzip.c
portability: Use g_strerror() in favor of strerror().
[libsigrok.git] / src / output / srzip.c
index 409421cbbf3b862721942d676f66e90dc5149faa..476ed57a2083cd178d3bc6800b10cbb7775858a1 100644 (file)
@@ -24,7 +24,7 @@
 #include <glib.h>
 #include <glib/gstdio.h>
 #include <zip.h>
-#include "libsigrok.h"
+#include <libsigrok/libsigrok.h>
 #include "libsigrok-internal.h"
 
 #define LOG_PREFIX "output/srzip"
@@ -96,7 +96,7 @@ static int zip_create(const struct sr_output *o)
        close(tmpfile);
        meta = g_fopen(metafile, "wb");
        fprintf(meta, "[global]\n");
-       fprintf(meta, "sigrok version = %s\n", PACKAGE_VERSION);
+       fprintf(meta, "sigrok version = %s\n", SR_PACKAGE_VERSION_STRING);
        fprintf(meta, "[device 1]\ncapturefile = logic-1\n");
        fprintf(meta, "total probes = %d\n", g_slist_length(o->sdi->channels));
        s = sr_samplerate_string(outc->samplerate);
@@ -186,7 +186,7 @@ static int zip_append(const struct sr_output *o, unsigned char *buf,
                if ((tmpfile = g_mkstemp(tmpname)) == -1)
                        return SR_ERR;
                if (write(tmpfile, metafile, len) < 0) {
-                       sr_dbg("Failed to create new metadata: %s", strerror(errno));
+                       sr_dbg("Failed to create new metadata: %s", g_strerror(errno));
                        g_free(metafile);
                        unlink(tmpname);
                        return SR_ERR;
@@ -317,6 +317,7 @@ SR_PRIV struct sr_output_module output_srzip = {
        .name = "srzip",
        .desc = "srzip session file",
        .exts = (const char*[]){"sr", NULL},
+       .flags = SR_OUTPUT_INTERNAL_IO_HANDLING,
        .options = get_options,
        .init = init,
        .receive = receive,