diff --git a/lib/Makefile.in b/lib/Makefile.in index 4602288a0..ebac6e57c 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -32,6 +32,7 @@ SOURCES=\ format_text/backup.c \ format_text/export.c \ format_text/flags.c \ + format_text/format-text.c \ format_text/import.c \ label/label.c \ log/log.c \ diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c index 13d077ddd..cd8deaccf 100644 --- a/lib/format_text/format-text.c +++ b/lib/format_text/format-text.c @@ -5,6 +5,7 @@ */ #include "format-text.h" +#include "import-export.h" #include "log.h" #include "pool.h" @@ -43,19 +44,19 @@ int _pv_setup(struct format_instance *fi, struct physical_volume *pv, struct volume_group *vg) { _not_written("_get_vgs"); - return NULL; + return 0; } int _pv_write(struct format_instance *fi, struct physical_volume *pv) { _not_written("_get_vgs"); - return NULL; + return 0; } int _vg_setup(struct format_instance *fi, struct volume_group *vg) { _not_written("_get_vgs"); - return NULL; + return 0; } struct volume_group *_vg_read(struct format_instance *fi, @@ -86,7 +87,7 @@ int _vg_write(struct format_instance *fi, struct volume_group *vg) void _destroy(struct format_instance *fi) { - pool_free(cmd->mem, fi); + pool_free(fi->cmd->mem, fi); } static struct format_handler _text_handler = { @@ -107,22 +108,22 @@ struct format_instance *text_format_create(struct cmd_context *cmd, const char *no_alloc = "Couldn't allocate text format object."; struct format_instance *fi; - char *file; + char *path; if (!(fi = pool_alloc(cmd->mem, sizeof(*fi)))) { log_err(no_alloc); return NULL; } - if (!(file = pool_strdup(cmd->mem, file))) { - pool_free(fi); + if (!(path = pool_strdup(cmd->mem, file))) { + pool_free(fi->cmd->mem, fi); log_err(no_alloc); return NULL; } fi->cmd = cmd; - fi->ops = _text_handler; - fi->private = file; + fi->ops = &_text_handler; + fi->private = path; return fi; } diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index 2cf6b3aa9..7de92ed81 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -342,7 +342,7 @@ static char *_generate_lv_name(struct volume_group *vg, { struct list *lvh; struct logical_volume *lv; - int high = -1, i, s; + int high = -1, i; list_iterate(lvh, &vg->lvs) { lv = &(list_item(lvh, struct lv_list)->lv);