dlls/dinput/effect_linuxinput.c: Check return value of 'write'. (bug # 16413)

Damjan Jovanovic damjan.jov at gmail.com
Mon Jan 5 06:27:09 CST 2009


On Mon, Jan 5, 2009 at 1:45 PM, titon barua <titanix88 at gmail.com> wrote:
> On Mon, 2009-01-05 at 08:47 +0100, Michael Karcher wrote:
>> Am Montag, den 05.01.2009, 11:06 +0600 schrieb titon barua:
>> > > GCC is complaining about the ignored return value.
>> > >
>> > As the code says /* we dont care */ but gcc prints warnings, is it ok
>> > with just
>> > "if (write(*(This->fd), &event, sizeof(event)));"
>> >
>> > Gcc wont complain and the code is as before?
>>
>> what about
>>  (void)write(*(This->fd), &event, sizeof(event));
>>
>> Does that work to? Seems nicer than the if.
>>
>> Regards,
>>   Michael Karcher
> Compiler warning remains.
>

ssize_t ignored;
...
ignored = write(*(This->fd), &event, sizeof(event));

You could make the ignored variable static, maybe even global.

Damjan



More information about the wine-devel mailing list