aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/hostnamed.c')
-rw-r--r--src/hostnamed.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/hostnamed.c b/src/hostnamed.c
index 1fb14c0..b476cdb 100644
--- a/src/hostnamed.c
+++ b/src/hostnamed.c
@@ -26,6 +26,8 @@
#include <gio/gio.h>
#include <polkit/polkit.h>
+#include <rc.h>
+
#include "hostnamed.h"
#include "hostname1-generated.h"
#include "utils.h"
@@ -68,10 +70,15 @@ hostname_is_valid (const gchar *name)
static gchar *
guess_icon_name ()
{
- /* TODO: detect virtualization by reading rc_sys */
gchar *filebuf = NULL;
gchar *ret = NULL;
+ /* Note that rc_sys() leaks memory :( */
+ if (rc_sys() != NULL) {
+ ret = g_strdup ("computer-vm");
+ goto out;
+ }
+
#if defined(__i386__) || defined(__x86_64__)
/*
Taken with a few minor changes from systemd's hostnamed