-#define _GNU_SOURCE
+#define _GNU_SOURCE 1
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
}
int main1(int rfd, int wfd) {
+ int ret_val;
+ (void)ret_val;
meshlink_set_log_cb(NULL, MESHLINK_DEBUG, log_cb);
meshlink_handle_t *mesh1 = meshlink_open("channels_conf.1", "foo", "channels", DEV_CLASS_BACKBONE);
}
size_t len = strlen(data);
- write(wfd, &len, sizeof(len));
- write(wfd, data, len);
+ ret_val = write(wfd, &len, sizeof(len));
+ ret_val = write(wfd, data, len);
free(data);
- read(rfd, &len, sizeof(len));
+ ret_val = read(rfd, &len, sizeof(len));
char indata[len + 1];
- read(rfd, indata, len);
+ ret_val = read(rfd, indata, len);
indata[len] = 0;
fprintf(stderr, "Foo exchanged data\n");
int main2(int rfd, int wfd) {
+ int ret_val;
+ (void)ret_val;
sleep(1);
meshlink_set_log_cb(NULL, MESHLINK_DEBUG, log_cb);
free(data);
- read(rfd, &len, sizeof(len));
+ ret_val = read(rfd, &len, sizeof(len));
char indata[len + 1];
- read(rfd, indata, len);
+ ret_val = read(rfd, indata, len);
indata[len] = 0;
fprintf(stderr, "Bar exchanged data\n");
int main() {
+ int ret_val;
+ (void)ret_val;
int fda[2], fdb[2];
- pipe2(fda, 0);
- pipe2(fdb, 0);
+ ret_val = pipe2(fda, 0);
+ ret_val = pipe2(fdb, 0);
if(fork()) {
return main1(fda[0], fdb[1]);
for(int i = 0; i < 3; i++) {
char *path;
- asprintf(&path, "trio_conf.%d", i);
+ int ret_val;
+ (void)ret_val;
+ ret_val = asprintf(&path, "trio_conf.%d", i);
assert(path);
mesh[i] = meshlink_open(path, name[i], "trio", DEV_CLASS_BACKBONE);
-#define _GNU_SOURCE
+#define _GNU_SOURCE 1
#include <stdio.h>
#include <stdlib.h>
*pa = *pb = NULL;
char *a_name, *b_name;
+ int ret_val;
+ (void)ret_val;
- asprintf(&a_name, "%s_conf.1", prefix);
+ ret_val = asprintf(&a_name, "%s_conf.1", prefix);
assert(a_name);
- asprintf(&b_name, "%s_conf.2", prefix);
+ ret_val = asprintf(&b_name, "%s_conf.2", prefix);
assert(b_name);
meshlink_handle_t *a = meshlink_open(a_name, "a", prefix, DEV_CLASS_BACKBONE);
}
void close_meshlink_pair(meshlink_handle_t *a, meshlink_handle_t *b, const char *prefix) {
+ int ret_val;
+ (void)ret_val;
meshlink_close(a);
meshlink_close(b);
if(prefix) {
char *a_name, *b_name;
- asprintf(&a_name, "%s_conf.1", prefix);
+ ret_val = asprintf(&a_name, "%s_conf.1", prefix);
assert(a_name);
assert(meshlink_destroy(a_name));
- asprintf(&b_name, "%s_conf.2", prefix);
+ ret_val = asprintf(&b_name, "%s_conf.2", prefix);
assert(b_name);
assert(meshlink_destroy(b_name));
}