blob: 2c9f573eb71474e828138072f02f4b37f60de9bb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
Index: screen/tty.sh
===================================================================
--- screen.orig/tty.sh 2013-01-26 07:55:33.092171499 +0000
+++ screen/tty.sh 2013-01-26 09:13:54.396260222 +0000
@@ -1506,11 +1506,15 @@
char *tty;
{
struct stat st;
-
- if (lstat(tty, &st) || !S_ISCHR(st.st_mode) ||
- (st.st_nlink > 1 && strncmp(tty, "/dev/", 5)))
- return -1;
- return 0;
+ if (0 == lstat(tty, &st)) {
+ if (S_ISCHR(st.st_mode) && (1 == st.st_nlink)) {
+ return 0;
+ } else if (S_ISLNK(st.st_mode)) {
+ if ((0 == stat(tty, &st)) && S_ISCHR(st.st_mode) && (1 == st.st_nlink))
+ return 0;
+ }
+ }
+ return -1;
}
/*
|