]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge remote-tracking branch 'fml/master'
authorAndre Noll <maan@systemlinux.org>
Fri, 25 Mar 2011 08:52:41 +0000 (09:52 +0100)
committerAndre Noll <maan@systemlinux.org>
Fri, 25 Mar 2011 08:52:41 +0000 (09:52 +0100)
para.h
udp_send.c

diff --git a/para.h b/para.h
index 29c5c2b89c4ac3e0ca820c26c07cd8be4755f266..08eb0ee6c20ab1a7779cc3f10de2b5fca094f44b 100644 (file)
--- 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.
  *
index 4fb10b444be321c51e7d33da2442fd6b8a469138..b4494eb7edb9e9fd26c1f4d20e9b81b06472c625 100644 (file)
@@ -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)