X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=afh.c;h=f2745b61b47e67310ce89dd78d9b95944021a7a4;hp=53c721161378193c385f7706bca47dc8ad97d2f9;hb=1cefe6a503c74d609db4e99e689d46575a5e40fd;hpb=d7b4aa3835197ee906f13f515040e1cda6385544 diff --git a/afh.c b/afh.c index 53c72116..f2745b61 100644 --- a/afh.c +++ b/afh.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2011 Andre Noll + * Copyright (C) 2008-2012 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -15,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 */ @@ -114,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);