X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=afh.c;h=4b4cc781144c5e0f68ac34ac8b98d3c5ad3f5912;hb=a5f5ca5e8d937f6e0a01f71832f209603e389219;hp=c5d7aec296a7a44b2fedfd2532ad838f89654e6c;hpb=0e3764a52eb6af123414ce07bcceb2c8bd2836c1;p=paraslash.git diff --git a/afh.c b/afh.c index c5d7aec2..4b4cc781 100644 --- a/afh.c +++ b/afh.c @@ -7,7 +7,6 @@ /** \file afh.c Paraslash's standalone audio format handler tool. */ #include -#include #include #include "para.h" @@ -16,6 +15,7 @@ #include "fd.h" #include "afh.h" #include "error.h" +#include "version.h" static struct afh_args_info conf; /** The list of all status items */ @@ -115,6 +115,10 @@ static int cat_file(struct afh_info *afhi, int audio_format_id, return -ERRNO_TO_PARA_ERROR(EINVAL); if (!afhi->chunks_total) return 1; + /* eliminate the possibility of short writes */ + ret = mark_fd_blocking(STDOUT_FILENO); + if (ret < 0) + return ret; if (first_chunk > 0 && !conf.no_header_given) { afh_get_header(afhi, audio_format_id, audio_file_data, audio_file_size, &header, &size);