summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2010-07-26 23:45:14 -0700
committerMarcel Holtmann <marcel@holtmann.org>2010-07-26 23:45:14 -0700
commit9dba290c7eaee7d5aa8a00ba536567d665300b1c (patch)
treec8913b8c3bc9a3c70b6372f3d795015945cafe97
parente4def1159e908e4beff52aa58214bcf1a2cbfb53 (diff)
downloadconnman-9dba290c7eaee7d5aa8a00ba536567d665300b1c.tar.gz
connman-9dba290c7eaee7d5aa8a00ba536567d665300b1c.tar.bz2
connman-9dba290c7eaee7d5aa8a00ba536567d665300b1c.zip
Fix return value of nameserver functions of resolver library
-rw-r--r--gresolv/gresolv.c10
-rw-r--r--gresolv/gresolv.h2
2 files changed, 6 insertions, 6 deletions
diff --git a/gresolv/gresolv.c b/gresolv/gresolv.c
index 2099cbc3..dad64384 100644
--- a/gresolv/gresolv.c
+++ b/gresolv/gresolv.c
@@ -338,17 +338,17 @@ void g_resolv_set_debug(GResolv *resolv,
resolv->debug_data = user_data;
}
-int g_resolv_add_nameserver(GResolv *resolv, const char *address,
+gboolean g_resolv_add_nameserver(GResolv *resolv, const char *address,
uint16_t port, unsigned long flags)
{
struct resolv_nameserver *nameserver;
if (resolv == NULL)
- return -EINVAL;
+ return FALSE;
nameserver = g_try_new0(struct resolv_nameserver, 1);
if (nameserver == NULL)
- return -ENOMEM;
+ return FALSE;
nameserver->address = g_strdup(address);
nameserver->port = port;
@@ -356,7 +356,7 @@ int g_resolv_add_nameserver(GResolv *resolv, const char *address,
if (connect_udp_channel(nameserver) < 0) {
free_nameserver(nameserver);
- return -EIO;
+ return FALSE;
}
nameserver->resolv = resolv;
@@ -366,7 +366,7 @@ int g_resolv_add_nameserver(GResolv *resolv, const char *address,
debug(resolv, "setting nameserver %s", address);
- return 0;
+ return TRUE;
}
void g_resolv_flush_nameservers(GResolv *resolv)
diff --git a/gresolv/gresolv.h b/gresolv/gresolv.h
index 1ea83470..d2472460 100644
--- a/gresolv/gresolv.h
+++ b/gresolv/gresolv.h
@@ -52,7 +52,7 @@ void g_resolv_unref(GResolv *resolv);
void g_resolv_set_debug(GResolv *resolv,
GResolvDebugFunc func, gpointer user_data);
-int g_resolv_add_nameserver(GResolv *resolv, const char *address,
+gboolean g_resolv_add_nameserver(GResolv *resolv, const char *address,
uint16_t port, unsigned long flags);
void g_resolv_flush_nameservers(GResolv *resolv);