On 31 January 2011 17:43, Julien Cristau <jcris...@debian.org> wrote:
> On Sun, Jan 30, 2011 at 00:00:48 +0100, Henri Verbeet wrote:
>
>> @@ -918,12 +921,15 @@ dri2CreateScreen(int screen, struct glx_display * priv)
>> return &psc->base;
>>
>> handle_error:
>> + if (psc->fd)
>> + close(psc->fd);
>
> 0 is a valid fd. It might be better to initialize fd to -1 and check
> for >= 0 here.
>
Yes, but isn't 0 defined to be stdin on any platform we care about?
Though another reason to initialize to -1 would be that I just noticed
we'd technically be passing an invalid fd to close() if the open
failed.
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev