diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2013-01-27 02:40:41 +0000 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2013-01-27 02:40:41 +0000 |
commit | c0827f2ce9459e6a1749a457a34c5c5d0cecc489 (patch) | |
tree | c7882c146a342bbf60dfaf4bf478875f2ed1d484 /debian/patches | |
parent | 843765cd95a8fcfb7db1b5d59399de96e0ee7893 (diff) | |
download | screen-c0827f2ce9459e6a1749a457a34c5c5d0cecc489.tar.gz |
Update solaris-dev-console.patch
Diffstat (limited to 'debian/patches')
-rw-r--r-- | debian/patches/solaris-dev-console.patch | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/debian/patches/solaris-dev-console.patch b/debian/patches/solaris-dev-console.patch index 2c9f573..1c1fd04 100644 --- a/debian/patches/solaris-dev-console.patch +++ b/debian/patches/solaris-dev-console.patch @@ -1,25 +1,33 @@ +Description: /dev/console may be a symlink + See http://lists.debian.org/debian-devel/2013/01/msg00576.html + In case of SunOS kernel (illumos) it is not possible for a device + file to have st_nlink != 1, so do not bother with "/devices/" 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 @@ +--- screen.orig/tty.sh 2013-01-27 02:16:57.916935245 +0000 ++++ screen/tty.sh 2013-01-27 02:33:12.831241123 +0000 +@@ -1506,11 +1506,21 @@ char *tty; { struct stat st; -- ++ char * real; ++ int rc; + - if (lstat(tty, &st) || !S_ISCHR(st.st_mode) || - (st.st_nlink > 1 && strncmp(tty, "/dev/", 5))) -- return -1; ++ real = realpath(tty, NULL); ++ if (!real) + 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; ++ ++ if (lstat(real, &st) || !S_ISCHR(st.st_mode) || ++ (st.st_nlink > 1 && strncmp(tty, "/dev/", 5))) ++ rc = -1; ++ else ++ rc = 0; ++ ++ free(real); ++ return rc; } /* |