From: Lennart Poettering Date: Mon, 25 Apr 2005 19:03:08 +0000 (+0000) Subject: correct some return values of flx_mdns_mcast_{leave,join}_{ipv6,ipv4}() X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=4128ce517280dde1e09d0d86b570f5a413812494;p=catta 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 --- 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) {