Commit d5e80113 authored by Vincent Torri's avatar Vincent Torri Committed by Jan Schmidt
Browse files

gst/rtsp/rtspconnection.c: Fix the MingW build.

Original commit message from CVS:
* gst/rtsp/rtspconnection.c: (rtsp_connection_create),
(rtsp_connection_connect):
Fix the MingW build.
Patch By: Vincent Torri <vtorri at univ-evry dot fr>
Fixes: #446981
parent 2e1747f7
2007-06-15 Jan Schmidt <thaytan@mad.scientist.com>
* gst/rtsp/rtspconnection.c: (rtsp_connection_create),
(rtsp_connection_connect):
Fix the MingW build.
Patch By: Vincent Torri <vtorri at univ-evry dot fr>
Fixes: #446981
2007-06-14 Jan Schmidt <thaytan@mad.scientist.com> 2007-06-14 Jan Schmidt <thaytan@mad.scientist.com>
* tests/check/elements/.cvsignore: * tests/check/elements/.cvsignore:
......
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
#include <winsock2.h> #include <winsock2.h>
#define EINPROGRESS WSAEINPROGRESS
#else #else
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <netdb.h> #include <netdb.h>
...@@ -122,6 +123,10 @@ rtsp_connection_create (RTSPUrl * url, RTSPConnection ** conn) ...@@ -122,6 +123,10 @@ rtsp_connection_create (RTSPUrl * url, RTSPConnection ** conn)
gint ret; gint ret;
RTSPConnection *newconn; RTSPConnection *newconn;
#ifdef G_OS_WIN32
unsigned long flags;
#endif /* G_OS_WIN32 */
g_return_val_if_fail (conn != NULL, RTSP_EINVAL); g_return_val_if_fail (conn != NULL, RTSP_EINVAL);
newconn = g_new0 (RTSPConnection, 1); newconn = g_new0 (RTSPConnection, 1);
...@@ -131,6 +136,9 @@ rtsp_connection_create (RTSPUrl * url, RTSPConnection ** conn) ...@@ -131,6 +136,9 @@ rtsp_connection_create (RTSPUrl * url, RTSPConnection ** conn)
/* pipe( CONTROL_SOCKETS(newconn) ) */ /* pipe( CONTROL_SOCKETS(newconn) ) */
if ((ret = pipe (CONTROL_SOCKETS (newconn))) < 0) if ((ret = pipe (CONTROL_SOCKETS (newconn))) < 0)
goto no_socket_pair; goto no_socket_pair;
ioctlsocket (READ_SOCKET (newconn), FIONBIO, &flags);
ioctlsocket (WRITE_SOCKET (newconn), FIONBIO, &flags);
#else #else
if ((ret = if ((ret =
socketpair (PF_UNIX, SOCK_STREAM, 0, CONTROL_SOCKETS (newconn))) < 0) socketpair (PF_UNIX, SOCK_STREAM, 0, CONTROL_SOCKETS (newconn))) < 0)
...@@ -177,6 +185,10 @@ rtsp_connection_connect (RTSPConnection * conn, GTimeVal * timeout) ...@@ -177,6 +185,10 @@ rtsp_connection_connect (RTSPConnection * conn, GTimeVal * timeout)
struct timeval tv, *tvp; struct timeval tv, *tvp;
gint max_fd, retval; gint max_fd, retval;
#ifdef G_OS_WIN32
unsigned long flags;
#endif /* G_OS_WIN32 */
g_return_val_if_fail (conn != NULL, RTSP_EINVAL); g_return_val_if_fail (conn != NULL, RTSP_EINVAL);
g_return_val_if_fail (conn->url != NULL, RTSP_EINVAL); g_return_val_if_fail (conn->url != NULL, RTSP_EINVAL);
g_return_val_if_fail (conn->fd < 0, RTSP_EINVAL); g_return_val_if_fail (conn->fd < 0, RTSP_EINVAL);
...@@ -211,7 +223,11 @@ rtsp_connection_connect (RTSPConnection * conn, GTimeVal * timeout) ...@@ -211,7 +223,11 @@ rtsp_connection_connect (RTSPConnection * conn, GTimeVal * timeout)
goto sys_error; goto sys_error;
/* set to non-blocking mode so that we can cancel the connect */ /* set to non-blocking mode so that we can cancel the connect */
#ifndef G_OS_WIN32
fcntl (fd, F_SETFL, O_NONBLOCK); fcntl (fd, F_SETFL, O_NONBLOCK);
#else
ioctlsocket (fd, FIONBIO, &flags);
#endif /* G_OS_WIN32 */
/* we are going to connect ASYNC now */ /* we are going to connect ASYNC now */
ret = connect (fd, (struct sockaddr *) &sa_in, sizeof (sa_in)); ret = connect (fd, (struct sockaddr *) &sa_in, sizeof (sa_in));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment