[vlc-devel] commit: Win32: fix sockets leak ( Rémi Denis-Courmont )

git version control git at videolan.org
Wed Jan 20 17:36:29 CET 2010


vlc-1.0-bugfix | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jan 20 18:36:21 2010 +0200| [f08e26a4c0685696da8f14b964cc3920e608575a] | committer: Rémi Denis-Courmont 

Win32: fix sockets leak

(cherry picked from commit 15569018d349a41cf9b9362918e196e08cbd95a2)

Conflicts:

	src/misc/objects.c

> http://git.videolan.org/gitweb.cgi/vlc-1.0-bugfix.git/?a=commit;h=f08e26a4c0685696da8f14b964cc3920e608575a
---

 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 ec1d0fb..e12fc66 100644
--- a/src/misc/objects.c
+++ b/src/misc/objects.c
@@ -52,6 +52,14 @@
 # include <io.h>
 # include <fcntl.h>
 # include <errno.h> /* ENOSYS */
+# 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 <assert.h>
@@ -305,9 +313,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
  */
@@ -348,13 +353,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