From: Andre Noll Date: Fri, 25 Mar 2011 08:52:41 +0000 (+0100) Subject: Merge remote-tracking branch 'fml/master' X-Git-Tag: v0.4.6~8 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=8428e93a6bd1998ddc2febab5779b8de23212a05;hp=75d545612d8fb51b7e6b2f8a7349b54502004cfa Merge remote-tracking branch 'fml/master' --- diff --git a/para.h b/para.h index 29c5c2b8..08eb0ee6 100644 --- a/para.h +++ b/para.h @@ -221,6 +221,9 @@ _static_inline_ long int para_random(unsigned max) /** Used to avoid a shortcoming in vim's syntax highlighting. */ #define EMBRACE(...) { __VA_ARGS__} +/** A nice cup of STFU for Mr gcc. */ +#define do_nothing do {/* nothing */} while (0) + /** * The sample formats supported by paraslash. * diff --git a/udp_send.c b/udp_send.c index 4fb10b44..b4494eb7 100644 --- a/udp_send.c +++ b/udp_send.c @@ -57,8 +57,13 @@ static void udp_close_target(struct sender_client *sc) const char *buf; size_t len = vss_get_fec_eof_packet(&buf); - /* ignore return value, closing the target anyway. */ - (void)write(sc->fd, buf, len); + /* + * Ignore the return value of wirte() since we are closing the target + * anyway. The sole purpose of the "do_nothing" statement is to silence + * gcc. + */ + if (write(sc->fd, buf, len)) + do_nothing; } static void udp_delete_target(struct sender_client *sc, const char *msg)