Remove obsolete file.
[connman] / src / resolver.c
index de60cf1..24caf73 100644 (file)
@@ -149,6 +149,9 @@ int connman_resolver_append(const char *interface, const char *domain,
 
        DBG("interface %s domain %s server %s", interface, domain, server);
 
+       if (server == NULL)
+               return -EINVAL;
+
        entry = g_try_new0(struct entry_data, 1);
        if (entry == NULL)
                return -ENOMEM;
@@ -250,11 +253,12 @@ static int resolvfile_append(const char *interface, const char *domain,
        fd = open("/etc/resolv.conf", O_RDWR | O_CREAT,
                                        S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
        if (fd < 0)
-               return errno;
+               return -errno;
 
        err = ftruncate(fd, 0);
 
-       cmd = g_strdup_printf("nameserver %s\n", server);
+       cmd = g_strdup_printf("# Generated by Connection Manager\n"
+                                               "nameserver %s\n", server);
 
        len = write(fd, cmd, strlen(cmd));