Mercurial > libavformat.hg
diff udp.c @ 1670:92afee454599 libavformat
The long awaited BeOS cleanup, phase 1
author | mmu_man |
---|---|
date | Thu, 18 Jan 2007 17:22:30 +0000 |
parents | 7316227e64eb |
children | f695f8fc4a63 |
line wrap: on
line diff
--- a/udp.c Thu Jan 18 15:42:25 2007 +0000 +++ b/udp.c Thu Jan 18 17:22:30 2007 +0000 @@ -23,11 +23,7 @@ #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> -#ifndef __BEOS__ # include <arpa/inet.h> -#else -# include "barpainet.h" -#endif #include <netdb.h> #ifndef IPV6_ADD_MEMBERSHIP @@ -214,11 +210,7 @@ fail: if (udp_fd >= 0) -#ifdef CONFIG_BEOS_NETSERVER closesocket(udp_fd); -#else - close(udp_fd); -#endif if(res0) freeaddrinfo(res0); return -1; @@ -421,11 +413,7 @@ return 0; fail: if (udp_fd >= 0) -#ifdef CONFIG_BEOS_NETSERVER closesocket(udp_fd); -#else - close(udp_fd); -#endif av_free(s); return AVERROR_IO; } @@ -482,22 +470,20 @@ { UDPContext *s = h->priv_data; -#ifndef CONFIG_BEOS_NETSERVER #ifndef CONFIG_IPV6 +#ifdef IP_DROP_MEMBERSHIP if (s->is_multicast && !(h->flags & URL_WRONLY)) { if (setsockopt(s->udp_fd, IPPROTO_IP, IP_DROP_MEMBERSHIP, &s->mreq, sizeof(s->mreq)) < 0) { perror("IP_DROP_MEMBERSHIP"); } } +#endif #else if (s->is_multicast && !(h->flags & URL_WRONLY)) udp_ipv6_leave_multicast_group(s->udp_fd, (struct sockaddr *)&s->dest_addr); #endif - close(s->udp_fd); -#else closesocket(s->udp_fd); -#endif av_free(s); return 0; }