mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
asprintf: fix test for error result
On error this function returns -1. Since the functions however do not propagate error upward, it's rather cleanup change.
This commit is contained in:
parent
0b6d6bfb77
commit
0e05e1cf6c
2
lib/cache/lvmetad.c
vendored
2
lib/cache/lvmetad.c
vendored
@ -124,7 +124,7 @@ void lvmetad_set_token(const struct dm_config_value *filter)
|
|||||||
filter = filter->next;
|
filter = filter->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dm_asprintf(&_lvmetad_token, "filter:%u", ft))
|
if (dm_asprintf(&_lvmetad_token, "filter:%u", ft) < 0)
|
||||||
log_warn("WARNING: Failed to set lvmetad token. Out of memory?");
|
log_warn("WARNING: Failed to set lvmetad token. Out of memory?");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,7 +166,7 @@ static int _clear_dev_from_lvmetad_cache(dev_t devno, int32_t major, int32_t min
|
|||||||
{
|
{
|
||||||
char *buf;
|
char *buf;
|
||||||
|
|
||||||
if (!dm_asprintf(&buf, "%" PRIi32 ":%" PRIi32, major, minor))
|
if (dm_asprintf(&buf, "%" PRIi32 ":%" PRIi32, major, minor) < 0)
|
||||||
stack;
|
stack;
|
||||||
if (!lvmetad_pv_gone(devno, buf ? : "", handler)) {
|
if (!lvmetad_pv_gone(devno, buf ? : "", handler)) {
|
||||||
dm_free(buf);
|
dm_free(buf);
|
||||||
|
Loading…
Reference in New Issue
Block a user