aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Peach <mrpeach@users.sourceforge.net>2010-08-04 17:18:56 +0000
committerMartin Peach <mrpeach@users.sourceforge.net>2010-08-04 17:18:56 +0000
commit929e553d64e8d52739a667445960b18452f685a3 (patch)
tree7c714e7374931ab6359dc19d5069dcf8e3d8b368
parentd9dd3c0ff10c12133b4bfaf95e68cad34aef35e5 (diff)
Removed remaining calls to things in s_stuff.h (sys_closesocket)
svn path=/trunk/externals/mrpeach/; revision=13745
-rw-r--r--net/udpsend.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/net/udpsend.c b/net/udpsend.c
index 0fd2c32..6890146 100644
--- a/net/udpsend.c
+++ b/net/udpsend.c
@@ -6,7 +6,6 @@
/* network */
#include "m_pd.h"
-#include "s_stuff.h"
#include <stdio.h>
#include <string.h>
@@ -24,6 +23,7 @@
#include <net/if.h> // for SIOCGIFCONF
#include <arpa/inet.h>
#include <errno.h>
+#include <unistd.h>
#endif // _WIN32
#ifdef __APPLE__
#include <ifaddrs.h> // for getifaddrs
@@ -121,7 +121,11 @@ Enable sending of broadcast messages (if hostname is a broadcast address)*/
if (connect(sockfd, (struct sockaddr *) &server, sizeof (server)) < 0)
{
udpsend_sock_err(x, "udpsend connect");
- sys_closesocket(sockfd);
+#ifdef _WIN32
+ closesocket(sockfd);
+#else
+ close(sockfd);
+#endif
return;
}
x->x_fd = sockfd;
@@ -401,7 +405,11 @@ static void udpsend_disconnect(t_udpsend *x)
{
if (x->x_fd >= 0)
{
- sys_closesocket(x->x_fd);
+#ifdef _WIN32
+ closesocket(x->x_fd);
+#else
+ close(x->x_fd);
+#endif
x->x_fd = -1;
outlet_float(x->x_obj.ob_outlet, 0);
}