]> sourceware.org Git - lvm2.git/commitdiff
libdm: config: fix dm_config_write_node and variants to properly return error on...
authorPeter Rajnoha <prajnoha@redhat.com>
Fri, 4 Mar 2016 14:49:00 +0000 (15:49 +0100)
committerPeter Rajnoha <prajnoha@redhat.com>
Fri, 4 Mar 2016 14:51:13 +0000 (15:51 +0100)
The error was not propagated if _write_config (that is part of
dm_config_write_node and all its variants) was called recursively
for subsections.

WHATS_NEW_DM
libdm/libdm-config.c

index d3eac299b51ab95d1f7bcf88580f5c5ceb77d333..109249a88f1a8cd9c214bc64a5aa7ffddcd13bbc 100644 (file)
@@ -1,5 +1,6 @@
 Version 1.02.119 -
 =====================================
+  Fix dm_config_write_node and variants to return error on subsection failures.
   Remove 4096 char limit due to buffer size if writing dm_config_node.
 
 Version 1.02.118 - 26th February 2016
index 5fa06a13197b74d122895ade977202470a9575e8..dcb7c3f81a7cf7cd084381cc47c171af5bae08b1 100644 (file)
@@ -366,7 +366,8 @@ static int _write_config(const struct dm_config_node *n, int only_one,
                        line_append(" {");
                        if (!_line_end(n, out))
                                return_0;
-                       _write_config(n->child, 0, out, level + 1);
+                       if (!_write_config(n->child, 0, out, level + 1))
+                               return_0;
                        if (!_line_start(out))
                                return_0;
                        line_append("%s}", space);
This page took 0.042909 seconds and 5 git commands to generate.