]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
coverity: open can return 0 as an fd, change error check to < 0
authorDwight Engen <dwight.engen@oracle.com>
Tue, 7 May 2013 14:57:09 +0000 (10:57 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Tue, 7 May 2013 17:26:57 +0000 (13:26 -0400)
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/bdev.c

index 1a611f9a503cc83556ca0fd438f8dc385915b369..181e98ea11915dafba7075a761b6f7b3d21b757d 100644 (file)
@@ -90,7 +90,7 @@ static int blk_getsize(const char *path, unsigned long *size)
        int fd, ret;
 
        fd = open(path, O_RDONLY);
-       if (!fd)
+       if (fd < 0)
                return -1;
        ret = ioctl(fd, BLKGETSIZE64, size);
        close(fd);