diff options
author | hwspeedy <ns@bigbear.dk> | 2024-04-28 15:30:38 +0200 |
---|---|---|
committer | hwspeedy <ns@bigbear.dk> | 2024-04-28 15:30:38 +0200 |
commit | 4153afe55440fdc3841d38d5feaf88937add74b7 (patch) | |
tree | cea6c98cd169a66ddeb159d07375f61a6a3a6d17 /modules/computer.c | |
parent | 3a21342979308eae15eb00a48aa9a2147d7db60e (diff) |
FIX focuslost, missing status updates, benchmark aborting improved
Diffstat (limited to 'modules/computer.c')
-rw-r--r-- | modules/computer.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/modules/computer.c b/modules/computer.c index 9b8c7a9c..11befa7b 100644 --- a/modules/computer.c +++ b/modules/computer.c @@ -454,6 +454,7 @@ static gchar *detect_machine_type(void) /* Table based off imvirt by Thomas Liske <liske@ibh.de> Copyright (c) 2008 IBH IT-Service GmbH under GPLv2. */ +char get_virtualization[100]={}; gchar *computer_get_virtualization(void) { gboolean found = FALSE; @@ -492,6 +493,8 @@ gchar *computer_get_virtualization(void) { NULL } }; gchar *tmp; + //Caching for speedup + if(get_virtualization[0]!=0) return g_strdup(get_virtualization); DEBUG("Detecting virtual machine"); @@ -526,6 +529,7 @@ gchar *computer_get_virtualization(void) if (found) { DEBUG("%s found (by reading file %s)", vm_types[j].vmtype, files[i]); + strcpy(get_virtualization,_(vm_types[j].vmtype));//Save return g_strdup(_(vm_types[j].vmtype)); } } @@ -533,8 +537,10 @@ gchar *computer_get_virtualization(void) } DEBUG("no virtual machine detected; assuming physical machine"); - - return detect_machine_type(); + char *c=detect_machine_type(); + strcpy(get_virtualization,c);//Save + free(c); + return g_strdup(get_virtualization); } gchar *callback_summary(void) |