From: Karel Zak Date: Tue, 31 Jan 2017 12:44:43 +0000 (+0100) Subject: lscpu: make osrelease file optional X-Git-Tag: v2.29.2~20 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c70a05e55e3c2d7493cd44c90960db7ae4884316;p=thirdparty%2Futil-linux.git lscpu: make osrelease file optional Signed-off-by: Karel Zak --- diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c index 183fc8a494..ec3dd4fd6a 100644 --- a/sys-utils/lscpu.c +++ b/sys-utils/lscpu.c @@ -918,7 +918,8 @@ read_hypervisor(struct lscpu_desc *desc, struct lscpu_modifier *mod) /* We have to detect WSL first. is_vmware_platform() crashes on Windows 10. */ - if ((fd = path_fopen("r", 1, _PATH_PROC_OSRELEASE))) { + if (path_exist(_PATH_PROC_OSRELEASE) + && (fd = path_fopen("r", 1, _PATH_PROC_OSRELEASE))) { char buf[256]; if (fgets(buf, sizeof(buf), fd) != NULL) {