[tigervnc-devel] PATCH: Add xorg-xserver 1.19 support to tigervnc

Hans de Goede hdegoede at redhat.com
Mon Jan 9 19:15:03 UTC 2017


Hi,

On 09-01-17 18:12, Alan Coopersmith wrote:
> On 01/ 9/17 07:57 AM, Hans de Goede wrote:
>>      close(2);
>> +    /* Avoid xserver >= 1.19's epoll-fd becoming fd 2 / stderr only to be
>> +       replaced by /dev/null by OsInit() because the pollfd is not
>> +       writable, breaking ospoll_wait(). */
>> +    open("/dev/null", O_WRONLY);
>
> Hopefully no other threads in the X server are opening files, but if any ever
> do, it would be more reliable to do:
>
>     nullfd = open("/dev/null", O_WRONLY);
>     dup2(nullfd, 2);
>     close(nullfd);
>
> and let dup2 atomically close the old stderr and clone nullfd to it.

Yes I agree that would be better, Pierre, can you take care
of merging Alan's improved version ?

Regards,

Hans


More information about the xorg-devel mailing list