summaryrefslogtreecommitdiff
path: root/plugins/loopback.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-04-23 00:55:13 +0100
committerMarcel Holtmann <marcel@holtmann.org>2009-04-23 00:55:13 +0100
commitbce7ddce246b6bf4799db2c15099445f24b41715 (patch)
tree62105809a88ab426bd7db0da8341d3737207a874 /plugins/loopback.c
parentf67f58354bef906f35aa28346052d8f6b2ffae08 (diff)
downloadconnman-bce7ddce246b6bf4799db2c15099445f24b41715.tar.gz
connman-bce7ddce246b6bf4799db2c15099445f24b41715.tar.bz2
connman-bce7ddce246b6bf4799db2c15099445f24b41715.zip
Read domainname after reading the local hostname
Diffstat (limited to 'plugins/loopback.c')
-rw-r--r--plugins/loopback.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/plugins/loopback.c b/plugins/loopback.c
index 7eac1e87..0a3a1d34 100644
--- a/plugins/loopback.c
+++ b/plugins/loopback.c
@@ -147,6 +147,18 @@ static int setup_hostname(void)
connman_info("System hostname is %s", name);
+ memset(name, 0, sizeof(name));
+
+ if (getdomainname(name, HOST_NAME_MAX) < 0) {
+ connman_error("Failed to get current domainname");
+ return -EIO;
+ }
+
+ if (strcmp(name, "(none)") == 0)
+ return 0;
+
+ connman_info("System domainname is %s", name);
+
return 0;
}