1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

Allow compilation against a device-mapper that was installed into $DESTDIR

Always check for negative (error) return code from lv_active()
This commit is contained in:
Alasdair Kergon 2002-01-18 16:43:19 +00:00
parent 6fb1d0e114
commit 4af6dc9663
5 changed files with 15 additions and 5 deletions

View File

@ -64,6 +64,10 @@ CFLAGS+=-DDEBUG_MEM -DDEBUG
INCLUDES+=-I. -I$(top_srcdir)/include
INC_LNS=$(top_srcdir)/include/.symlinks_created
ifdef DESTDIR
INCLUDES+=-I$(DESTDIR)/usr/include
endif
STRIP=
#STRIP=-s
@ -118,7 +122,7 @@ clean: $(SUBDIRS.clean)
distclean: $(SUBDIRS.distclean)
$(RM) $(OBJECTS) $(TARGETS) $(SOURCES:%.c=%.d)
$(RM) config.cache config.log config.status
$(RM) Makefile make.tmpl
$(RM) Makefile make.tmpl version.h
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),distclean)

View File

@ -139,7 +139,10 @@ static int lvchange_availability(struct logical_volume *lv)
if (strcmp(arg_str_value(available_ARG, "n"), "n"))
activate = 1;
active = lv_active(lv);
if ((active = lv_active(lv)) < 0) {
log_error("Unable to determine status of %s", lv->name);
return 0;
}
if (activate && active) {
log_verbose("Logical volume %s is already active", lv->name);

View File

@ -107,7 +107,10 @@ int lvrename(int argc, char **argv)
if (!archive(lv->vg))
return ECMD_FAILED;
active = lv_active(lv);
if ((active = lv_active(lv)) < 0) {
log_error("Unable to determine status of %s", lv->name);
return ECMD_FAILED;
}
if (active && !lv_suspend(lv)) {
log_error("Failed to suspend %s", lv->name);

View File

@ -258,7 +258,7 @@ int lvresize(int argc, char **argv)
if (argc)
log_print("Ignoring PVs on command line when reducing");
if (lv_active(lv)) {
if (lv_active(lv) > 0) {
dummy =
display_size(extents * vg->extent_size / 2,
SIZE_SHORT);

View File

@ -64,7 +64,7 @@ static int lvscan_single(struct logical_volume *lv)
const char *active_str, *snapshot_str;
/* FIXME Add -D arg to skip this! */
if (lv_active(lv)) {
if (lv_active(lv) > 0) {
active_str = "ACTIVE ";
active++;
} else