From: Tim-Philipp Müller Date: Tue, 11 Apr 2006 18:43:04 +0000 (+0000) Subject: libs/gst/net/gstnettimepacket.c: MSG_DONTWAIT is not defined on Cygwin, so work aroun... X-Git-Tag: RELEASE-0_10_5~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7916e14a2550717a093c9f20df94d7e0ec06e17d;p=platform%2Fupstream%2Fgstreamer.git 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). --- diff --git a/ChangeLog b/ChangeLog index 607e815..6407d2f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-04-11 Tim-Philipp Müller + + * 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 * gst/gstelementfactory.c: (gst_element_register), diff --git a/libs/gst/net/gstnettimepacket.c b/libs/gst/net/gstnettimepacket.c index 16c311a..6091c15 100644 --- a/libs/gst/net/gstnettimepacket.c +++ b/libs/gst/net/gstnettimepacket.c @@ -32,6 +32,11 @@ #include "config.h" #endif +#ifdef __CYGWIN__ +# include +# include +#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);