/*
- * Copyright (C) 2008-2011 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2008-2012 Andre Noll <maan@systemlinux.org>
*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
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);
int ret2;
ret = mmap_full_file(conf.inputs[i], O_RDONLY, &audio_file_data,
&audio_file_size, &fd);
- if (ret < 0)
+ if (ret < 0) {
+ PARA_ERROR_LOG("failed to mmap \"%s\"\n", conf.inputs[i]);
goto out;
+ }
ret = compute_afhi(conf.inputs[i], audio_file_data, audio_file_size,
fd, &afhi);
if (ret < 0)