lscpu: make /proc/sysinfo usage more robust [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2013-03-27 15:59:40 +01:00
parent e36aad2139
commit b3eff5dd74
1 changed files with 2 additions and 0 deletions

View File

@ -551,6 +551,8 @@ read_hypervisor(struct lscpu_desc *desc, struct lscpu_modifier *mod)
FILE *fd = path_fopen("r", 0, _PATH_PROC_SYSINFO);
char buf[BUFSIZ];
if (!fd)
return;
desc->hyper = HYPER_IBM;
desc->hypervisor = "PR/SM";
desc->virtype = VIRT_FULL;