From: Karel Zak Date: Tue, 31 Jan 2017 12:44:43 +0000 (+0100) Subject: lscpu: make osrelease file optional X-Git-Tag: v2.30-rc1~276 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4dfc54b6b17386d68a621d6c7f4e341e8736340f;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 0ba8154288..318e93b435 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) {