From: Marcel Holtmann Date: Wed, 22 Apr 2009 23:55:13 +0000 (+0100) Subject: Read domainname after reading the local hostname X-Git-Tag: 2.0_alpha~3843 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bce7ddce246b6bf4799db2c15099445f24b41715;p=framework%2Fconnectivity%2Fconnman.git Read domainname after reading the local hostname --- diff --git a/plugins/loopback.c b/plugins/loopback.c index 7eac1e8..0a3a1d3 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; }