]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
isosize: don't ignore read() result [coverity scan]
authorKarel Zak <kzak@redhat.com>
Tue, 4 Oct 2016 13:56:59 +0000 (15:56 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 4 Oct 2016 13:56:59 +0000 (15:56 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/isosize.c

index 0f676ca8868e8bbb7dea1a5328dfa8a7f695b5ed..5ae5a9e1bc242843860bb194709bb4bc6a9d91e7 100644 (file)
@@ -138,7 +138,7 @@ static void isosize(int argc, char *filenamep, int xflag, long divisor)
        if (lseek(fd, 16 << 11, 0) == (off_t) - 1)
                err(EXIT_FAILURE, _("seek error on %s"), filenamep);
 
-       if (read(fd, &ipd, sizeof(ipd)) < 0)
+       if (read(fd, &ipd, sizeof(ipd)) != (ssize_t) sizeof(ipd))
                err(EXIT_FAILURE, _("read error on %s"), filenamep);
 
        nsecs = isonum_733(ipd.volume_space_size, xflag);