From: Paolo Bonzini Date: Thu, 24 Nov 2011 15:36:50 +0000 (+0100) Subject: util: fix thinko in runIO X-Git-Tag: v0.9.8-rc1~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1b62f983b9f53f75abec99a82e4d270322bd46b;p=thirdparty%2Flibvirt.git util: fix thinko in runIO When aligning you need to clear the bits in the mask and leave the others aside. Likely this code has never run, and will never run. Signed-off-by: Paolo Bonzini --- diff --git a/src/util/iohelper.c b/src/util/iohelper.c index 9e7bbdef92..93154f8945 100644 --- a/src/util/iohelper.c +++ b/src/util/iohelper.c @@ -98,7 +98,7 @@ runIO(const char *path, int fd, int oflags, unsigned long long length) goto cleanup; } base = buf; - buf = (char *) (((intptr_t) base + alignMask) & alignMask); + buf = (char *) (((intptr_t) base + alignMask) & ~alignMask); #endif switch (oflags & O_ACCMODE) {