]> git.meshlink.io Git - meshlink/commitdiff
Don't clear node dirty flag in meshlink_stop().
authorGuus Sliepen <guus@meshlink.io>
Wed, 3 Feb 2021 22:30:36 +0000 (23:30 +0100)
committerGuus Sliepen <guus@meshlink.io>
Wed, 3 Mar 2021 11:39:50 +0000 (12:39 +0100)
It's node_write_config() itself that should unset the dirty flag, depending
on the storage policy and if storage succeeded. Otherwise, we risk that
setting the storage policy back to ENABLED after calling meshlink_stop()
will not cause pending updates to be written out by meshlink_close().

src/meshlink.c

index 26bcada773151a382772e2117e05d5bb101ce67f..da7305515bec02fb4687b91afa0d08b02819dd96 100644 (file)
@@ -1846,7 +1846,9 @@ void meshlink_stop(meshlink_handle_t *mesh) {
        if(mesh->nodes) {
                for splay_each(node_t, n, mesh->nodes) {
                        if(n->status.dirty) {
-                               n->status.dirty = !node_write_config(mesh, n, false);
+                               if(!node_write_config(mesh, n, false)) {
+                                       // ignore
+                               }
                        }
                }
        }