]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: fix thinko in runIO
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 24 Nov 2011 15:36:50 +0000 (16:36 +0100)
committerEric Blake <eblake@redhat.com>
Fri, 25 Nov 2011 12:37:39 +0000 (05:37 -0700)
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 <pbonzini@redhat.com>
src/util/iohelper.c

index 9e7bbdef92d2f979a705a50f44184b4cdd45e4f7..93154f89454c19f690a8ef3c8279a1a77d0be30e 100644 (file)
@@ -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) {