]> git.meshlink.io Git - meshlink/blobdiff - examples/channels.c
Fix __warn_unused_result__, add more of it and fix the resulting warnings.
[meshlink] / examples / channels.c
index 70c27004fb4f7216dad47f3f738d1de129477499..0f23de89c617af11a66b8615b9589b878586c712 100644 (file)
@@ -136,7 +136,10 @@ static void parse_command(meshlink_handle_t *mesh, char *buf) {
                        return;
                }
 
-               meshlink_blacklist(mesh, node);
+               if(!meshlink_blacklist(mesh, node)) {
+                       fprintf(stderr, "Error blacklising '%s': %s", arg, meshlink_strerror(meshlink_errno));
+                       return;
+               }
 
                printf("Node '%s' blacklisted.\n", arg);
        } else if(!strcasecmp(buf, "whitelist")) {
@@ -152,7 +155,10 @@ static void parse_command(meshlink_handle_t *mesh, char *buf) {
                        return;
                }
 
-               meshlink_whitelist(mesh, node);
+               if(!meshlink_whitelist(mesh, node)) {
+                       fprintf(stderr, "Error whitelising '%s': %s", arg, meshlink_strerror(meshlink_errno));
+                       return;
+               }
 
                printf("Node '%s' whitelisted.\n", arg);
        } else if(!strcasecmp(buf, "who")) {