]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/fireinfo/0003-Skip-search-for-hypervisor-name-when-the-CPU-string-.patch
Merge remote-tracking branch 'ms/x86_64' into next
[ipfire-2.x.git] / src / patches / fireinfo / 0003-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
257ce821
MT
4Subject: [PATCH 3/5] Skip search for hypervisor name when the CPU string is
5 empty
afa91a4d
MT
6
7---
8 src/_fireinfo/fireinfo.c | 11 ++++++-----
9 1 file changed, 6 insertions(+), 5 deletions(-)
10
11diff --git a/src/_fireinfo/fireinfo.c b/src/_fireinfo/fireinfo.c
12index fc639d9d4cd9..6601c21a733f 100644
13--- a/src/_fireinfo/fireinfo.c
14+++ b/src/_fireinfo/fireinfo.c
15@@ -156,11 +156,12 @@ int detect_hypervisor(int *hypervisor) {
16
17 *hypervisor = HYPER_OTHER;
18
19- int id;
20- for (id = HYPER_NONE + 1; id < HYPER_LAST; id++) {
21- if (strcmp(hypervisor_ids[id], sig.text) == 0) {
22- *hypervisor = id;
23- break;
24+ if (*sig.text) {
25+ for (int id = HYPER_NONE + 1; id < HYPER_LAST; id++) {
26+ if (strcmp(hypervisor_ids[id], sig.text) == 0) {
27+ *hypervisor = id;
28+ break;
29+ }
30 }
31 }
32
33--
257ce821 342.4.3
afa91a4d 35