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

Alan Coopersmith alan.coopersmith at oracle.com
Mon Jan 9 17:12:42 UTC 2017


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.

-- 
	-Alan Coopersmith-              alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc


More information about the xorg-devel mailing list