[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] 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 <pbonzini redhat com>
---
 src/util/iohelper.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/util/iohelper.c b/src/util/iohelper.c
index 9e7bbde..93154f8 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) {
-- 
1.7.7.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]