From bb6ddc2de7f6bba43cd567946528c886e3ddb3d2 Mon Sep 17 00:00:00 2001 From: AJ Lewis Date: Tue, 21 Aug 2001 15:23:45 +0000 Subject: [PATCH] o Added a basic makefile to build liblvm.a again o Modified source files so that this works --- lib/Makefile | 23 +++++++++++++++++++++++ lib/config/config.c | 4 ++-- lib/dev-mgr/dev-manager.c | 12 ++++++++---- lib/dev-mgr/dev-manager.h | 2 +- lib/mm/dbg_malloc.c | 2 +- lib/mm/pool.c | 2 +- 6 files changed, 36 insertions(+), 9 deletions(-) create mode 100644 lib/Makefile diff --git a/lib/Makefile b/lib/Makefile new file mode 100644 index 000000000..150b293f2 --- /dev/null +++ b/lib/Makefile @@ -0,0 +1,23 @@ + +CFLAGS = -I. + +SRC= \ + config/config.c \ + dev-mgr/dev-manager.c \ + dev-mgr/hash.c \ + log/log.c \ + mm/pool.c \ + mm/dbg_malloc.c + +OBJ=${SRC:.c=.o} +TARGET=liblvm.a + +all: ${TARGET} + +liblvm.a: $(OBJ) + rm -f $@ + ar r $@ $(OBJ) + ranlib $@ + +clean: + rm -f ${OBJ} ${TARGET} diff --git a/lib/config/config.c b/lib/config/config.c index 5eb250ff2..67c0832dc 100644 --- a/lib/config/config.c +++ b/lib/config/config.c @@ -29,8 +29,8 @@ */ #include "config.h" -#include "pool.h" -#include "log.h" +#include "mm/pool.h" +#include "log/log.h" #include #include diff --git a/lib/dev-mgr/dev-manager.c b/lib/dev-mgr/dev-manager.c index ecb5e472b..a2d1212e9 100644 --- a/lib/dev-mgr/dev-manager.c +++ b/lib/dev-mgr/dev-manager.c @@ -35,9 +35,13 @@ * */ -#include "liblvm.h" +#include +#include +#include +#include #include "hash.h" -#include "pool.h" +#include "mm/pool.h" +#include "log/log.h" #include "dev-manager.h" #define DEFAULT_BASE_DIR "/dev" @@ -223,7 +227,7 @@ static int _dir_scan(struct dev_mgr *dm, const char *dirname) static struct dev_i *_add(struct dev_mgr *dm, const char *directory, const char *devname) { - char devpath[NAME_LEN]; + char devpath[128]; if (!directory || !devname) return 0; @@ -239,7 +243,7 @@ static struct dev_i *_add_named_device(struct dev_mgr *dm, const char *devpath) struct stat stat_b; /* FIXME: move lvm_check_dev into this file */ - if ((stat(devpath, &stat_b) == -1) || lvm_check_dev(&stat_b, TRUE)) + if ((stat(devpath, &stat_b) == -1) || lvm_check_dev(&stat_b, 1)) goto out; /* Check for directories and scan them if they aren't this directory diff --git a/lib/dev-mgr/dev-manager.h b/lib/dev-mgr/dev-manager.h index a5e9d7113..2c1c9f173 100644 --- a/lib/dev-mgr/dev-manager.h +++ b/lib/dev-mgr/dev-manager.h @@ -22,7 +22,7 @@ #ifndef DEV_MANAGER_H #define DEV_MANAGER_H -#include "config.h" +#include "config/config.h" struct device { char *name; diff --git a/lib/mm/dbg_malloc.c b/lib/mm/dbg_malloc.c index e15256adc..8d5023622 100644 --- a/lib/mm/dbg_malloc.c +++ b/lib/mm/dbg_malloc.c @@ -32,7 +32,7 @@ #include #include "dbg_malloc.h" -#include "log.h" +#include "log/log.h" struct memblock { struct memblock *prev, *next; /* All allocated blocks are linked */ diff --git a/lib/mm/pool.c b/lib/mm/pool.c index 2df9b956c..03e0e2cea 100644 --- a/lib/mm/pool.c +++ b/lib/mm/pool.c @@ -22,7 +22,7 @@ #include "pool.h" #include "dbg_malloc.h" -#include "log.h" +#include "log/log.h" #include