diff --git a/amidi/amidi.c b/amidi/amidi.c index cde4697..90e7750 100644 --- a/amidi/amidi.c +++ b/amidi/amidi.c @@ -688,8 +688,11 @@ int main(int argc, char *argv[]) continue; read += length; - if (receive_file != -1) - write(receive_file, buf, length); + if (receive_file != -1) { + ssize_t wlength = write(receive_file, buf, length); + if (wlength != length) + error("write error: %s", wlength < 0 ? strerror(errno) : "short"); + } if (dump) { for (i = 0; i < length; ++i) print_byte(buf[i]); diff --git a/seq/aseqnet/aseqnet.c b/seq/aseqnet/aseqnet.c index 70a1cfd..ebdea0b 100644 --- a/seq/aseqnet/aseqnet.c +++ b/seq/aseqnet/aseqnet.c @@ -491,8 +491,11 @@ static void flush_writebuf(void) if (cur_wrlen) { int i; for (i = 0; i < max_connection; i++) { - if (netfd[i] >= 0) - write(netfd[i], writebuf, cur_wrlen); + if (netfd[i] >= 0) { + ssize_t wrlen = write(netfd[i], writebuf, cur_wrlen); + if (wrlen != (ssize_t)cur_wrlen) + fprintf(stderr, "write error: %s", wrlen < 0 ? strerror(errno) : "short"); + } } cur_wrlen = 0; }