|
From: | Paolo Bonzini |
Subject: | Re: [Qemu-devel] [PATCH] audio: Fix using freed pointer in wav_fini_out |
Date: | Fri, 13 Jun 2014 09:47:36 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 |
Il 13/06/2014 09:15, Markus Armbruster ha scritto:
I'm afraid this is not an improvement. Your patch makes the code ignore fclose() failure silently. This is a common mistake. fclose() failure after write can mean data loss, and the user certainly needs to know about that.
If you want that, the best solution is to first fflush() and then fclose(). Then you're sure that the fclose() doesn't cause data loss and you can safely ignore its result (it shouldn't fail).
Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |