- size_t len = vss_get_fec_eof_packet(&buf);
-
- /*
- * Ignore the return value of write() 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;
+ size_t len;
+ struct udp_target *ut = sc->private_data;
+
+ if (ut->sent_fec_eof)
+ return;
+ PARA_NOTICE_LOG("sending FEC EOF\n");
+ len = vss_get_fec_eof_packet(&buf);
+ /* Ignore write() errors since we are closing the target anyway. */
+ if (write(sc->fd, buf, len) == len)
+ ut->sent_fec_eof = true;