File util-linux-lscpu-wsl-regression.patch of Package util-linux.7828

From 4dfc54b6b17386d68a621d6c7f4e341e8736340f Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Tue, 31 Jan 2017 13:44:43 +0100
Subject: [PATCH] lscpu: make osrelease file optional

Signed-off-by: Karel Zak <kzak@redhat.com>
---
 sys-utils/lscpu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c
index 0ba815428..318e93b43 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) {
-- 
2.11.0

openSUSE Build Service is sponsored by