[FFmpeg-devel] [PATCH] ffmpeg: check fclose return values

Ganesh Ajjanagadde gajjanag at mit.edu
Thu Jan 7 19:00:47 CET 2016

On Thu, Jan 7, 2016 at 9:27 AM, Michael Niedermayer
<michael at niedermayer.cc> wrote:
> On Wed, Jan 06, 2016 at 09:00:46PM -0800, Ganesh Ajjanagadde wrote:
>> In the spirit of commit a956840cbc. Simple method to reproduce:
>> pass -vstats_file /dev/full to ffmpeg.
>> All raw fclose usages in ffmpeg.c taken care of here.
>> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
>> ---
>>  ffmpeg.c | 13 ++++++++++---
>>  1 file changed, 10 insertions(+), 3 deletions(-)
> thanks

So there is actually a problem with the diagnostic obtained, a more
accurate diagnostic is via errno, say strerror(errno) instead of
Error closing vstats file, loss of information possible: Operation not permitted
Error closing vstats file, loss of information possible: No space left on device
for the provided /dev/full example.

So there are a number of possiblities:
1. Have 2 separate av_log lines, one for each of these.
2. A single av_log line, using strerror(errno).
3. Leave as is.

I prefer 2. Let me know your preference, and I will push later.

> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> Many that live deserve death. And some that die deserve life. Can you give
> it to them? Then do not be too eager to deal out death in judgement. For
> even the very wise cannot see all ends. -- Gandalf
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

More information about the ffmpeg-devel mailing list