summaryrefslogtreecommitdiff
path: root/pm
diff options
context:
space:
mode:
authorVictor Lowther <victor.lowther@gmail.com>2008-03-15 18:04:11 -0500
committerVictor Lowther <victor.lowther@gmail.com>2008-03-15 18:04:11 -0500
commit1de164bdd3915e7c93329a9df77064ed7b402ea1 (patch)
tree6cde124c4c2b2dd546276ba302cf200fdb88808f /pm
parent40cf5324abdfa5eac08cba836ca84097849ad188 (diff)
Mostly seperated vt switching logic from the suspend_lock logic.
This should fix the breakage implemented by moving the locking.
Diffstat (limited to 'pm')
-rw-r--r--pm/pm-functions.in6
-rwxr-xr-xpm/sleep.d/00clear2
2 files changed, 4 insertions, 4 deletions
diff --git a/pm/pm-functions.in b/pm/pm-functions.in
index d7ba77c..1e86739 100644
--- a/pm/pm-functions.in
+++ b/pm/pm-functions.in
@@ -80,8 +80,6 @@ log() { [ $LOGGING ] && echo $*; }
take_suspend_lock()
{
- VT=$(fgconsole)
- chvt 63
try_lock "pm-utils.lock" || return 1
mkdir -p "${STORAGEDIR}"
return 0
@@ -89,9 +87,9 @@ take_suspend_lock()
remove_suspend_lock()
{
+ local curr_vt=$(fgconsole)
+ [ "$curr_vt" = "$VT" ] || chvt "$VT"
rm -rf "${STORAGEDIR}"
- chvt 1
- chvt $VT
release_lock "pm-utils.lock"
}
diff --git a/pm/sleep.d/00clear b/pm/sleep.d/00clear
index 6649199..a0c5081 100755
--- a/pm/sleep.d/00clear
+++ b/pm/sleep.d/00clear
@@ -5,7 +5,9 @@
case "$1" in
hibernate|suspend*)
TERM=linux openvt -w -s -f -c 63 -- clear >/dev/null 2>&1
+ chvt 63
;;
+ thaw|resume) chvt 1 ;;
*)
;;
esac