1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00

Add dm_config_find_str_allow_empty

Support empty string values.
This commit is contained in:
Zdenek Kabelac 2011-12-21 12:47:44 +00:00
parent 14a165bf3f
commit 6298758992
3 changed files with 8 additions and 1 deletions

View File

@ -6,7 +6,7 @@ Version 1.02.68 -
Improve man page style for dmsetup.
Fix _get_proc_number to be tolerant of malformed /proc/misc entries.
Add ExecReload to dm-event.service for systemd to reload dmeventd properly.
Add dm_config_tree_find_str_allow_empty.
Add dm_config_tree_find_str_allow_empty and dm_config_find_str_allow_empty.
Fix compile-time pool memory locking with DEBUG_MEM.
Fix valgrind error reports in free of pool chunks with DEBUG_MEM.
Align size of structure chunk for fast pool allocator to 8 bytes.

View File

@ -1351,6 +1351,7 @@ int dm_config_write_node(const struct dm_config_node *cn, dm_putline_fn putline,
struct dm_config_node *dm_config_find_node(struct dm_config_node *cn, const char *path);
int dm_config_has_node(const struct dm_config_node *cn, const char *path);
const char *dm_config_find_str(const struct dm_config_node *cn, const char *path, const char *fail);
const char *dm_config_find_str_allow_empty(const struct dm_config_node *cn, const char *path, const char *fail);
int dm_config_find_int(const struct dm_config_node *cn, const char *path, int fail);
float dm_config_find_float(const struct dm_config_node *cn, const char *path, float fail);

View File

@ -772,6 +772,12 @@ const char *dm_config_find_str(const struct dm_config_node *cn,
return _find_config_str(cn, _find_config_node, path, fail, 0);
}
const char *dm_config_find_str_allow_empty(const struct dm_config_node *cn,
const char *path, const char *fail)
{
return _find_config_str(cn, _find_config_node, path, fail, 1);
}
static int64_t _find_config_int64(const void *start, node_lookup_fn find,
const char *path, int64_t fail)
{