X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=blobdiff_plain;f=src%2Foutput%2Fsrzip.c;h=d80a7a188cb428feea45d80f91804083f4365970;hp=ae066cde228b4f66a240458cf0f803281b0e6db4;hb=e57057aee778e723da572a6b5e2bd01526cc7beb;hpb=c1aae90038456a61d0f9313d34e6107c3440d3e7 diff --git a/src/output/srzip.c b/src/output/srzip.c index ae066cde..d80a7a18 100644 --- a/src/output/srzip.c +++ b/src/output/srzip.c @@ -17,6 +17,7 @@ * along with this program. If not, see . */ +#include #include #include #include @@ -96,7 +97,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 +187,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; @@ -282,6 +283,8 @@ static int receive(const struct sr_output *o, const struct sr_datafeed_packet *p } logic = packet->payload; ret = zip_append(o, logic->data, logic->unitsize, logic->length); + if (ret != SR_OK) + return ret; break; }