Check that hostname and domainname is valid
authorMarcel Holtmann <marcel@holtmann.org>
Thu, 23 Apr 2009 00:04:38 +0000 (01:04 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 23 Apr 2009 00:04:38 +0000 (01:04 +0100)
plugins/loopback.c

index 0a3a1d3..04bd7a1 100644 (file)
@@ -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;
 }