Commit 42fb4b15 by Dwight Engen Committed by Stéphane Graber

coverity: open can return 0 as an fd, change error check to < 0

parent 91c908ee
...@@ -90,7 +90,7 @@ static int blk_getsize(const char *path, unsigned long *size) ...@@ -90,7 +90,7 @@ static int blk_getsize(const char *path, unsigned long *size)
int fd, ret; int fd, ret;
fd = open(path, O_RDONLY); fd = open(path, O_RDONLY);
if (!fd) if (fd < 0)
return -1; return -1;
ret = ioctl(fd, BLKGETSIZE64, size); ret = ioctl(fd, BLKGETSIZE64, size);
close(fd); close(fd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment