screen says "Bad tty" if /dev/console is a symlink
Before filling a bug, I need a review :-)
The patch fo screen.cc  introduces the function CheckTtyname():
struct stat st;
if (lstat(tty, &st) || !S_ISCHR(st.st_mode) ||
(st.st_nlink > 1 && strncmp(tty, "/dev/", 5)))
When I run screen on a "real" console, screen says "Bad tty '/dev/console'"
I guess this is due to:
1. /dev/console is a symlink (don't ask ;-):
# ls -lh /dev/console
lrwxrwxrwx 1 root root 30 May 13 2012 /dev/console ->
2. lstat() stats a symlink itself, and it is obviosly not a character device.
Does it make sense to replace lstat() with stat()?