[PATCH] linux: Fix error message when /dev/tty0 fails to open

Julien Cristau jcristau at debian.org
Sat Jan 14 02:52:03 PST 2012


On Fri, Jan 13, 2012 at 16:12:25 -0800, Chad Versace wrote:

> When attempting to open the console device during initialization, X first
> tries to open /dev/tty0 in write-only mode, and if that fails it attempts
> to open /dev/vc/0. If both attempts fail, the error message below is
> logged. The message is incorrect because the errno is that resulting from
> the failure to open /dev/vc/0.
> 
>     xf86OpenConsole: Cannot open /dev/tty0 ({strerror(errno)})
> 
> On a machine in which /dev/tty0 does exist but /dev/vc/0 does not, such as
> my machine, the log misleadingly says:
> 
>     Fatal server error:
>     [  3167.976] xf86OpenConsole: Cannot open /dev/tty0 (No such file or directory)
> 
> This patch fixes the log to report the correct errno for each device. The
> result is this log snippet:
> 
>     [  3755.177] (WW) xf86OpenConsole: Failed to open /dev/tty0 for writing (Permission denied)
>     [  3755.177] (WW) xf86OpenConsole: Failed to open /dev/vc/0 for writing (No such file or directory)
>     [  3755.177]
>     Fatal server error:
>     [  3755.177] xf86OpenConsole: Failed to open console device
> 
Maybe we should just drop the /dev/vc/0 stuff?  Surely nobody uses devfs
anymore?

Cheers,
Julien


More information about the xorg-devel mailing list