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:
parent
6fb1d0e114
commit
4af6dc9663
@ -64,6 +64,10 @@ CFLAGS+=-DDEBUG_MEM -DDEBUG
|
|||||||
INCLUDES+=-I. -I$(top_srcdir)/include
|
INCLUDES+=-I. -I$(top_srcdir)/include
|
||||||
INC_LNS=$(top_srcdir)/include/.symlinks_created
|
INC_LNS=$(top_srcdir)/include/.symlinks_created
|
||||||
|
|
||||||
|
ifdef DESTDIR
|
||||||
|
INCLUDES+=-I$(DESTDIR)/usr/include
|
||||||
|
endif
|
||||||
|
|
||||||
STRIP=
|
STRIP=
|
||||||
#STRIP=-s
|
#STRIP=-s
|
||||||
|
|
||||||
@ -118,7 +122,7 @@ clean: $(SUBDIRS.clean)
|
|||||||
distclean: $(SUBDIRS.distclean)
|
distclean: $(SUBDIRS.distclean)
|
||||||
$(RM) $(OBJECTS) $(TARGETS) $(SOURCES:%.c=%.d)
|
$(RM) $(OBJECTS) $(TARGETS) $(SOURCES:%.c=%.d)
|
||||||
$(RM) config.cache config.log config.status
|
$(RM) config.cache config.log config.status
|
||||||
$(RM) Makefile make.tmpl
|
$(RM) Makefile make.tmpl version.h
|
||||||
|
|
||||||
ifneq ($(MAKECMDGOALS),clean)
|
ifneq ($(MAKECMDGOALS),clean)
|
||||||
ifneq ($(MAKECMDGOALS),distclean)
|
ifneq ($(MAKECMDGOALS),distclean)
|
||||||
|
@ -139,7 +139,10 @@ static int lvchange_availability(struct logical_volume *lv)
|
|||||||
if (strcmp(arg_str_value(available_ARG, "n"), "n"))
|
if (strcmp(arg_str_value(available_ARG, "n"), "n"))
|
||||||
activate = 1;
|
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) {
|
if (activate && active) {
|
||||||
log_verbose("Logical volume %s is already active", lv->name);
|
log_verbose("Logical volume %s is already active", lv->name);
|
||||||
|
@ -107,7 +107,10 @@ int lvrename(int argc, char **argv)
|
|||||||
if (!archive(lv->vg))
|
if (!archive(lv->vg))
|
||||||
return ECMD_FAILED;
|
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)) {
|
if (active && !lv_suspend(lv)) {
|
||||||
log_error("Failed to suspend %s", lv->name);
|
log_error("Failed to suspend %s", lv->name);
|
||||||
|
@ -258,7 +258,7 @@ int lvresize(int argc, char **argv)
|
|||||||
if (argc)
|
if (argc)
|
||||||
log_print("Ignoring PVs on command line when reducing");
|
log_print("Ignoring PVs on command line when reducing");
|
||||||
|
|
||||||
if (lv_active(lv)) {
|
if (lv_active(lv) > 0) {
|
||||||
dummy =
|
dummy =
|
||||||
display_size(extents * vg->extent_size / 2,
|
display_size(extents * vg->extent_size / 2,
|
||||||
SIZE_SHORT);
|
SIZE_SHORT);
|
||||||
|
@ -64,7 +64,7 @@ static int lvscan_single(struct logical_volume *lv)
|
|||||||
const char *active_str, *snapshot_str;
|
const char *active_str, *snapshot_str;
|
||||||
|
|
||||||
/* FIXME Add -D arg to skip this! */
|
/* FIXME Add -D arg to skip this! */
|
||||||
if (lv_active(lv)) {
|
if (lv_active(lv) > 0) {
|
||||||
active_str = "ACTIVE ";
|
active_str = "ACTIVE ";
|
||||||
active++;
|
active++;
|
||||||
} else
|
} else
|
||||||
|
Loading…
Reference in New Issue
Block a user