1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

libdm: config: fix dm_config_write_node and variants to properly return error on failures

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.
This commit is contained in:
Peter Rajnoha 2016-03-04 15:49:00 +01:00
parent 67c5006e12
commit 9720898c8e
2 changed files with 3 additions and 1 deletions

View 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

View 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);