libs/gst/net/gstnettimepacket.c: MSG_DONTWAIT is not defined on Cygwin, so work around that (fixes #317048).

Original commit message from CVS:
* libs/gst/net/gstnettimepacket.c: (gst_net_time_packet_send):
MSG_DONTWAIT is not defined on Cygwin, so work
around that (fixes #317048).
This commit is contained in:
Tim-Philipp Müller 2006-04-11 18:43:04 +00:00
parent 001890e6b2
commit 7916e14a25
2 changed files with 28 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2006-04-11 Tim-Philipp Müller <tim at centricular dot net>
* libs/gst/net/gstnettimepacket.c: (gst_net_time_packet_send):
MSG_DONTWAIT is not defined on Cygwin, so work
around that (fixes #317048).
2006-04-11 Wim Taymans <wim@fluendo.com>
* gst/gstelementfactory.c: (gst_element_register),

View file

@ -32,6 +32,11 @@
#include "config.h"
#endif
#ifdef __CYGWIN__
# include <unistd.h>
# include <fcntl.h>
#endif
#include "gstnettimepacket.h"
@ -164,14 +169,29 @@ gint
gst_net_time_packet_send (const GstNetTimePacket * packet, gint fd,
struct sockaddr * addr, socklen_t len)
{
#ifdef __CYGWIN__
gint fdflags;
#endif
guint8 *buffer;
gint ret;
gint ret, send_flags;
g_return_val_if_fail (packet != NULL, -EINVAL);
#ifdef __CYGWIN__
send_flags = 0;
fdflags = fcntl (fd, F_GETFL);
fcntl (fd, F_SETFL, fdflags | O_NONBLOCK);
#else
send_flags = MSG_DONTWAIT;
#endif
buffer = gst_net_time_packet_serialize (packet);
ret = sendto (fd, buffer, GST_NET_TIME_PACKET_SIZE, MSG_DONTWAIT, addr, len);
ret = sendto (fd, buffer, GST_NET_TIME_PACKET_SIZE, send_flags, addr, len);
#ifdef __CYGWIN__
fcntl (fd, F_SETFL, fdflags);
#endif
g_free (buffer);