[vlc-devel] commit: Win32: fix sockets leak ( Rémi Denis-Courmont )
git version control
git at videolan.org
Wed Jan 20 17:35:23 CET 2010
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jan 20 18:34:41 2010 +0200| [15569018d349a41cf9b9362918e196e08cbd95a2] | committer: Rémi Denis-Courmont
Win32: fix sockets leak
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=15569018d349a41cf9b9362918e196e08cbd95a2
---
src/misc/objects.c | 18 ++++++++----------
1 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/src/misc/objects.c b/src/misc/objects.c
index c904a0d..ab3cec3 100644
--- a/src/misc/objects.c
+++ b/src/misc/objects.c
@@ -50,6 +50,14 @@
# include <unistd.h>
#else
# include <io.h>
+# include <winsock2.h>
+# include <ws2tcpip.h>
+# undef read
+# define read( a, b, c ) recv (a, b, c, 0)
+# undef write
+# define write( a, b, c ) send (a, b, c, 0)
+# undef close
+# define close( a ) closesocket (a)
#endif
#include <search.h>
@@ -303,9 +311,6 @@ static void vlc_object_destroy( vlc_object_t *p_this )
#ifdef WIN32
-# include <winsock2.h>
-# include <ws2tcpip.h>
-
/**
* select()-able pipes emulated using Winsock
*/
@@ -346,13 +351,6 @@ error:
closesocket (c);
return -1;
}
-
-#undef read
-#define read( a, b, c ) recv (a, b, c, 0)
-#undef write
-#define write( a, b, c ) send (a, b, c, 0)
-#undef close
-#define close( a ) closesocket (a)
#endif /* WIN32 */
static vlc_mutex_t pipe_lock = VLC_STATIC_MUTEX;
More information about the vlc-devel
mailing list