]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/fireinfo-Skip-search-for-hypervisor-name-when-the-CPU-string-.patch
core91: Add changed pppsetup.cgi and language files
[ipfire-2.x.git] / src / patches / fireinfo-Skip-search-for-hypervisor-name-when-the-CPU-string-.patch
CommitLineData
afa91a4d
MT
1From c667589410912ca980a78f417e86dd6585d58f9a Mon Sep 17 00:00:00 2001
2From: Michael Tremer <michael.tremer@ipfire.org>
3Date: Mon, 4 May 2015 16:00:31 +0200
4Subject: [PATCH] Skip search for hypervisor name when the CPU string is empty
5
6---
7 src/_fireinfo/fireinfo.c | 11 ++++++-----
8 1 file changed, 6 insertions(+), 5 deletions(-)
9
10diff --git a/src/_fireinfo/fireinfo.c b/src/_fireinfo/fireinfo.c
11index fc639d9d4cd9..6601c21a733f 100644
12--- a/src/_fireinfo/fireinfo.c
13+++ b/src/_fireinfo/fireinfo.c
14@@ -156,11 +156,12 @@ int detect_hypervisor(int *hypervisor) {
15
16 *hypervisor = HYPER_OTHER;
17
18- int id;
19- for (id = HYPER_NONE + 1; id < HYPER_LAST; id++) {
20- if (strcmp(hypervisor_ids[id], sig.text) == 0) {
21- *hypervisor = id;
22- break;
23+ if (*sig.text) {
24+ for (int id = HYPER_NONE + 1; id < HYPER_LAST; id++) {
25+ if (strcmp(hypervisor_ids[id], sig.text) == 0) {
26+ *hypervisor = id;
27+ break;
28+ }
29 }
30 }
31
32--
332.1.0
34