diff options
author | Koop Mast <kwm@FreeBSD.org> | 2015-03-23 12:18:14 +0000 |
---|---|---|
committer | Koop Mast <kwm@FreeBSD.org> | 2015-03-23 12:18:14 +0000 |
commit | ef44dbe331f8a6fe925823fa9ac947930be79a9c (patch) | |
tree | 872b2892d9ec30acb94f7b9c97ec8b98d8a29572 /sysutils/consolekit/files/ck-get-x11-display-device | |
parent | www/pecl-http: Update version 2.3.2=>2.4.1 (diff) |
Fix a segvault, which was caused by a not validating if a enviroment string
is empty or not [1]
Add addition way to find the ttyv device from the Xorg.log [2]
PR: 198697 [1]
Submitted by: Pete Johanson <peter@peterjohanson.com> [1], dumbbell@ [1][2]
Notes
Notes:
svn path=/head/; revision=381990
Diffstat (limited to 'sysutils/consolekit/files/ck-get-x11-display-device')
-rw-r--r-- | sysutils/consolekit/files/ck-get-x11-display-device | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sysutils/consolekit/files/ck-get-x11-display-device b/sysutils/consolekit/files/ck-get-x11-display-device index 7efc08471660..ccfc78c69b7c 100644 --- a/sysutils/consolekit/files/ck-get-x11-display-device +++ b/sysutils/consolekit/files/ck-get-x11-display-device @@ -26,6 +26,11 @@ pid=$(${CAT} "/tmp/.X${dispnum}-lock") device=$(${FSTAT} -p ${pid} | ${GREP} ttyv | ${AWK} '{print $8}') +if [ -z "${device}" -a -f "/var/log/Xorg.$dispnum.log" ]; then + device=$(awk '/using VT number/ { print "ttyv" ($7 - 1); }' \ + "/var/log/Xorg.$dispnum.log") +fi + if [ -z "${device}" ]; then echo "ERROR: Failed to find TTY device for X server on display ${dispnum}" exit 1 |