From: Dwight Engen Date: Tue, 7 May 2013 14:57:09 +0000 (-0400) Subject: coverity: open can return 0 as an fd, change error check to < 0 X-Git-Tag: lxc-1.0.0.alpha1~1^2~224 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42fb4b1585d5f2073fbfe984acd46b625fd3c6a1;p=thirdparty%2Flxc.git coverity: open can return 0 as an fd, change error check to < 0 Signed-off-by: Dwight Engen Acked-by: Serge E. Hallyn --- diff --git a/src/lxc/bdev.c b/src/lxc/bdev.c index 1a611f9a5..181e98ea1 100644 --- a/src/lxc/bdev.c +++ b/src/lxc/bdev.c @@ -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);