[libdvdcss-devel] [PATCH] Check the return values of write() calls.
Diego Biurrun
diego at biurrun.de
Tue Mar 12 16:11:18 CET 2013
On Tue, Mar 12, 2013 at 11:03:59AM +0100, Reimar Döffinger wrote:
> Diego Biurrun <diego at biurrun.de> wrote:
>
> >Fixes the following two warnings:
> >src/libdvdcss.c:380:18: warning: ignoring return value of ‘write’,
> >declared with attribute warn_unused_result [-Wunused-result]
> >src/css.c:275:18: warning: ignoring return value of ‘write’, declared
> >with attribute warn_unused_result [-Wunused-result]
>
> Uh, am I reading that right that you make the code fail playing the
> DVD just because we failed to write to the cache? (Plus I think you
> forgot to close the file) I'm quite sure that the point of the warning
> is not to make people break their code. Unfortunately ignoring the
> result is the only sensible thing I can think of. I was thinking about
> suggesting to delete the presumably corrupted file, but it doesn't
> seem like a really good idea either, particularly since it might
> actually still be fine if write returns 0. I guess printing a warning
> should be fine though.
I see no better alternative than printing a warning either.
Then again, the whole cache directory tag thing looks like
another dead remnant from the days of yore.
Diego
More information about the libdvdcss-devel
mailing list