From 1de164bdd3915e7c93329a9df77064ed7b402ea1 Mon Sep 17 00:00:00 2001 From: Victor Lowther Date: Sat, 15 Mar 2008 18:04:11 -0500 Subject: Mostly seperated vt switching logic from the suspend_lock logic. This should fix the breakage implemented by moving the locking. --- pm/pm-functions.in | 6 ++---- pm/sleep.d/00clear | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'pm') 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 -- cgit v1.2.3