summaryrefslogtreecommitdiffstats
path: root/tools/pvchange.c
diff options
context:
space:
mode:
authorAlasdair Kergon <agk@redhat.com>2005-01-20 18:11:53 +0000
committerAlasdair Kergon <agk@redhat.com>2005-01-20 18:11:53 +0000
commit52f9afec22020d7bc2ebc940d83ee516328f7b61 (patch)
tree5360083750df439a56cf1acf8f8c80013c7d76a7 /tools/pvchange.c
parentc44c015a2d3bf0d2f5605c062c03375b4f73cd27 (diff)
downloadlvm2-52f9afec22020d7bc2ebc940d83ee516328f7b61.tar.gz
lvm2-52f9afec22020d7bc2ebc940d83ee516328f7b61.tar.xz
lvm2-52f9afec22020d7bc2ebc940d83ee516328f7b61.zip
Always fail if random id generation fails.
Diffstat (limited to 'tools/pvchange.c')
-rw-r--r--tools/pvchange.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/pvchange.c b/tools/pvchange.c
index c54b3560..5a8cf6c8 100644
--- a/tools/pvchange.c
+++ b/tools/pvchange.c
@@ -173,7 +173,11 @@ static int _pvchange_single(struct cmd_context *cmd, struct physical_volume *pv,
}
} else {
/* --uuid: Change PV ID randomly */
- id_create(&pv->id);
+ if (!id_create(&pv->id)) {
+ log_error("Failed to generate new random UUID for %s.",
+ pv_name);
+ return 0;
+ }
}
log_verbose("Updating physical volume \"%s\"", pv_name);