[libdvdcss-devel] [PATCH] Check the return values of write() calls.
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Tue Mar 12 11:03:59 CET 2013
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.
More information about the libdvdcss-devel
mailing list