summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2005-04-25 19:03:08 +0000
committerLennart Poettering <lennart@poettering.net>2005-04-25 19:03:08 +0000
commit4128ce517280dde1e09d0d86b570f5a413812494 (patch)
treeaf90accd9632ccac603b8832c368da06a5cabccc
parentba8547ee3f34d8fe7bedb559530b2c0374f2089c (diff)
correct some return values of flx_mdns_mcast_{leave,join}_{ipv6,ipv4}()
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@32 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
-rw-r--r--socket.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/socket.c b/socket.c
index e6cf40f..48a5d4b 100644
--- a/socket.c
+++ b/socket.c
@@ -50,10 +50,10 @@ int flx_mdns_mcast_join_ipv4 (int index, int fd)
if (setsockopt(fd, SOL_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)) < 0) {
g_warning("IP_ADD_MEMBERSHIP failed: %s\n", strerror(errno));
- return 0;
- } else {
return -1;
- }
+ }
+
+ return 0;
}
int flx_mdns_mcast_join_ipv6 (int index, int fd)
@@ -61,7 +61,6 @@ int flx_mdns_mcast_join_ipv6 (int index, int fd)
struct ipv6_mreq mreq6;
struct sockaddr_in6 sa6;
-
mdns_mcast_group_ipv6 (&sa6);
memset(&mreq6, 0, sizeof(mreq6));
@@ -70,10 +69,10 @@ int flx_mdns_mcast_join_ipv6 (int index, int fd)
if (setsockopt(fd, SOL_IPV6, IPV6_ADD_MEMBERSHIP, &mreq6, sizeof(mreq6)) < 0) {
g_warning("IPV6_ADD_MEMBERSHIP failed: %s\n", strerror(errno));
- return 0;
- } else {
return -1;
}
+
+ return 0;
}
int flx_mdns_mcast_leave_ipv4 (int index, int fd)
@@ -89,10 +88,10 @@ int flx_mdns_mcast_leave_ipv4 (int index, int fd)
if (setsockopt(fd, SOL_IP, IP_DROP_MEMBERSHIP, &mreq, sizeof(mreq)) < 0) {
g_warning("IP_DROP_MEMBERSHIP failed: %s\n", strerror(errno));
- return 0;
- } else {
return -1;
}
+
+ return 0;
}
int flx_mdns_mcast_leave_ipv6 (int index, int fd)
@@ -108,10 +107,10 @@ int flx_mdns_mcast_leave_ipv6 (int index, int fd)
if (setsockopt(fd, SOL_IPV6, IPV6_DROP_MEMBERSHIP, &mreq6, sizeof(mreq6)) < 0) {
g_warning("IPV6_DROP_MEMBERSHIP failed: %s\n", strerror(errno));
- return 0;
- } else {
return -1;
}
+
+ return 0;
}
gint flx_open_socket_ipv4(void) {