mesh: Skip unneeded logs
authorMichał Lowas-Rzechonek <michal.lowas-rzechonek@silvair.com>
Thu, 3 Feb 2022 14:38:00 +0000 (15:38 +0100)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 15 May 2023 09:25:53 +0000 (14:55 +0530)
Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
mesh/keyring.c
mesh/rpl.c

index 767d587..7799648 100644 (file)
@@ -208,7 +208,7 @@ bool keyring_put_remote_dev_key(struct mesh_node *node, uint16_t unicast,
 
        snprintf(key_file, PATH_MAX, "%s%s", node_path, dev_key_dir);
 
-       if (mkdir(key_file, 0755) != 0)
+       if (mkdir(key_file, 0755) != 0 && errno != EEXIST)
                l_error("Failed to create dir(%d): %s", errno, key_file);
 
        for (i = 0; i < count; i++) {
index a55dc89..80cc349 100644 (file)
@@ -83,7 +83,7 @@ bool rpl_put_entry(struct mesh_node *node, uint16_t src, uint32_t iv_index,
        iv_index--;
        snprintf(src_file, PATH_MAX, "%s%s/%8.8x/%4.4x", node_path, rpl_dir,
                                                                iv_index, src);
-       if (remove(src_file) < 0)
+       if (remove(src_file) < 0 && errno != ENOENT)
                l_error("Failed to remove(%d): %s", errno, src_file);
 
        return result;