From 7c8bd3fcd0e04bd41abb78512274ec0fa2b2eefa Mon Sep 17 00:00:00 2001 From: Patrick Caulfield Date: Tue, 12 Mar 2002 15:27:51 +0000 Subject: [PATCH] Fix _align so it works on 64-bit machines. --- libdm/ioctl/libdevmapper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libdm/ioctl/libdevmapper.c b/libdm/ioctl/libdevmapper.c index 3a88a1a80..b94d7efab 100644 --- a/libdm/ioctl/libdevmapper.c +++ b/libdm/ioctl/libdevmapper.c @@ -131,9 +131,10 @@ struct target *create_target(uint64_t start, return NULL; } -static void *_align(void *ptr, unsigned int align) +static void *_align(void *ptr, unsigned int a) { - align--; + register unsigned long align = --a; + return (void *) (((unsigned long) ptr + align) & ~align); }