[Mplayer-cvslog] CVS: main/libmpdemux stream_ftp.c,1.1,1.2

Sascha Sommer CVS faust3 at mplayerhq.hu
Sat Aug 16 12:54:17 CEST 2003


Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var/tmp.root/cvs-serv24870/libmpdemux

Modified Files:
	stream_ftp.c 
Log Message:
ftp support for mingw

Index: stream_ftp.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/stream_ftp.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- stream_ftp.c	15 Aug 2003 19:13:23 -0000	1.1
+++ stream_ftp.c	16 Aug 2003 10:53:44 -0000	1.2
@@ -11,6 +11,11 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <errno.h>
+#ifndef HAVE_WINSOCK2
+#define closesocket close
+#else
+#include <winsock2.h>
+#endif
 
 #include "mp_msg.h"
 #include "stream.h"
@@ -256,7 +261,7 @@
   if(select(p->handle+1, &fds, NULL, NULL, &tv) > 0) {
     if(readresp(p,rsp_txt) != 2)
       mp_msg(MSGT_OPEN,MSGL_WARN, "[ftp] Warning the server didn't finished the transfert correctly: %s\n",rsp_txt);
-    close(s->fd);
+    closesocket(s->fd);
     s->fd = -1;
   }
 
@@ -266,7 +271,7 @@
     //int fl;
     
     // First close the fd
-    close(s->fd);
+    closesocket(s->fd);
     s->fd = 0;
     
     // Send send the telnet sequence needed to make the server react
@@ -334,13 +339,13 @@
   if(!p) return;
 
   if(s->fd > 0) {
-    close(s->fd);
+    closesocket(s->fd);
     s->fd = 0;
   }
 
   FtpSendCmd("QUIT\r\n",p,NULL);
 
-  if(p->handle) close(p->handle);
+  if(p->handle) closesocket(p->handle);
   if(p->buf) free(p->buf);
 
   m_struct_free(&stream_opts,p);



More information about the MPlayer-cvslog mailing list