mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-06 11:27:17 +00:00
coverity: open can return 0 as an fd, change error check to < 0
Signed-off-by: Dwight Engen <dwight.engen@oracle.com> Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
parent
91c908ee8e
commit
42fb4b1585
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user