1
0
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:
Zdenek Kabelac 2014-04-17 10:05:56 +02:00
parent 0b6d6bfb77
commit 0e05e1cf6c
2 changed files with 2 additions and 2 deletions

2
lib/cache/lvmetad.c vendored
View File

@ -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?");
} }

View File

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