[Pkg-libvirt-commits] [libguestfs] 47/72: builder: Fix comparison between signed/unsigned in parallel xzcat.

Hilko Bengen bengen at moszumanska.debian.org
Sun Apr 5 15:19:51 UTC 2015


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch master
in repository libguestfs.

commit 901c7220e8f24af46fb5de58a701887e444116e3
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Mon Mar 9 13:13:16 2015 +0000

    builder: Fix comparison between signed/unsigned in parallel xzcat.
    
    block.header_size is uint32_t so cannot be compared directly with n (ssize_t).
    
    pxzcat-c.c: In function 'worker_thread':
    pxzcat-c.c:602:21: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
         if (n >= 0 && n != block.header_size-1) {
                         ^
    
    (cherry picked from commit 3053785db82c3aaf935c582146fd863d3618910f)
---
 builder/pxzcat-c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builder/pxzcat-c.c b/builder/pxzcat-c.c
index 17886d6..28a021b 100644
--- a/builder/pxzcat-c.c
+++ b/builder/pxzcat-c.c
@@ -565,7 +565,7 @@ worker_thread (void *vp)
 
     /* Now read and decode the block header. */
     n = pread (global->fd, &header[1], block.header_size-1, position);
-    if (n >= 0 && n != block.header_size-1) {
+    if (n >= 0 && n != (ssize_t) block.header_size-1) {
       fprintf (stderr,
                "%s: read: unexpected end of file reading block header\n",
                global->filename);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list