summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-04-23 01:04:38 +0100
committerMarcel Holtmann <marcel@holtmann.org>2009-04-23 01:04:38 +0100
commiteb0286572813ca040954e6a54eb18e2683415072 (patch)
treebb80d556ba0a33e25e9ccf0e89eb330c1d3788ea
parentbce7ddce246b6bf4799db2c15099445f24b41715 (diff)
downloadconnman-eb0286572813ca040954e6a54eb18e2683415072.tar.gz
connman-eb0286572813ca040954e6a54eb18e2683415072.tar.bz2
connman-eb0286572813ca040954e6a54eb18e2683415072.zip
Check that hostname and domainname is valid
-rw-r--r--plugins/loopback.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/plugins/loopback.c b/plugins/loopback.c
index 0a3a1d34..04bd7a1c 100644
--- a/plugins/loopback.c
+++ b/plugins/loopback.c
@@ -145,7 +145,8 @@ static int setup_hostname(void)
return -EIO;
}
- connman_info("System hostname is %s", name);
+ if (strlen(name) > 0 && strcmp(name, "(none)") != 0)
+ connman_info("System hostname is %s", name);
memset(name, 0, sizeof(name));
@@ -154,10 +155,8 @@ static int setup_hostname(void)
return -EIO;
}
- if (strcmp(name, "(none)") == 0)
- return 0;
-
- connman_info("System domainname is %s", name);
+ if (strlen(name) > 0 && strcmp(name, "(none)") != 0)
+ connman_info("System domainname is %s", name);
return 0;
}