summaryrefslogtreecommitdiff
path: root/extras/multipath/main.c
diff options
context:
space:
mode:
authorchristophe.varoqui@free.fr <christophe.varoqui@free.fr>2003-12-07 08:44:59 -0800
committerGreg KH <gregkh@suse.de>2005-04-26 21:13:06 -0700
commit2bf80b67d1a64f1219bd366cee355e897596b2cf (patch)
tree4417e2d94c900bdeccc556db9ef89e42a7e102fe /extras/multipath/main.c
parent83fa40fc2a9ad7790f4d1289c9e918d8e6ebe99d (diff)
[PATCH] extras/multipath update
here is the next update which brings this multipath to the state i'm not ashamed of it being in udev :) * drop a libdevmapper copy in extras/multipath; maybe discussions w/ Sistina folks will bring a better solution in the future. * drop a putchar usage in libdevmapper to compile cleanly with klibc * drop another such usage of my own in main.c * massage the Makefile to compile libdevmapper against klibc * use "ld" to produce the binary rather than "gcc -static" * stop being stupid w/ uneeded major, minor & dev in main.c:dm_mk_node() * reverse to creating striped target for now because the multipath target is more hairy than expected initialy * push the version code to 009 to be in synch w/ udev builds & run here. binary size is 43ko, which is fairly gratifying after all the efforts I've put to compiling it with klibc :)
Diffstat (limited to 'extras/multipath/main.c')
-rw-r--r--extras/multipath/main.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/extras/multipath/main.c b/extras/multipath/main.c
index b5ab664433..f3f92e7eba 100644
--- a/extras/multipath/main.c
+++ b/extras/multipath/main.c
@@ -26,7 +26,7 @@
#include <string.h>
#include <sys/ioctl.h>
#include <libsysfs.h>
-#include <libdevmapper.h>
+#include "libdevmapper/libdevmapper.h"
#include "main.h"
static int
@@ -458,9 +458,7 @@ static int
make_dm_node(char * str)
{
int r = 0;
- dev_t dev;
char buff[FILE_NAME_SIZE];
- int major, minor;
struct dm_names * names;
unsigned next = 0;
struct dm_task *dmt;
@@ -486,14 +484,9 @@ make_dm_node(char * str)
names = (void *) names + next;
} while (next);
- major = (int) MAJOR(names->dev);
- minor = (int) MINOR(names->dev);
-
- dev = major << sizeof(dev_t);
- dev = dev | minor;
sprintf(buff, "/dev/mapper/%s", str);
unlink(buff);
- mknod(buff, 0600 | S_IFBLK, dev);
+ mknod(buff, 0600 | S_IFBLK, names->dev);
out:
dm_task_destroy(dmt);
@@ -729,9 +722,10 @@ main(int argc, char *argv[])
if (conf.verbose) {
print_all_path(&conf, all_paths);
- printf("\n");
+ fprintf(stdout, "\n");
print_all_mp(all_paths, mp, nmp);
- printf("\n");
+ fprintf(stdout, "\n");
+ //printf("\n");
}
if (conf.dry_run)