summaryrefslogtreecommitdiff
path: root/pm/pm-functions.in
diff options
context:
space:
mode:
Diffstat (limited to 'pm/pm-functions.in')
-rw-r--r--pm/pm-functions.in6
1 files changed, 2 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"
}