From: Andre Noll Date: Sun, 11 Dec 2011 19:21:53 +0000 (+0100) Subject: afh: Use write_all rather than plain write(). X-Git-Tag: v0.4.10~11^2~7 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=5ac6b5f44f64ff9a2f0e01a65013da829edfab9e;p=paraslash.git afh: Use write_all rather than plain write(). We are currently using plain write() to write out the audio file header. If this results in a short write, or if the write is interrupted, we should just try again. So it's safer to call write_all() here. --- diff --git a/afh.c b/afh.c index 8810a28b..b76c72fd 100644 --- a/afh.c +++ b/afh.c @@ -124,7 +124,7 @@ static int cat_file(struct afh_info *afhi, int audio_format_id, &header, &size); if (size > 0) { PARA_INFO_LOG("writing header (%zu bytes)\n", size); - ret = write(STDOUT_FILENO, header, size); /* FIXME */ + ret = write_all(STDOUT_FILENO, header, size); afh_free_header(header, audio_format_id); if (ret < 0) return ret;