diff options
author | Victor Lowther <victor.lowther@gmail.com> | 2008-03-15 17:07:49 -0500 |
---|---|---|
committer | Victor Lowther <victor.lowther@gmail.com> | 2008-03-15 17:07:49 -0500 |
commit | de8659ed4bb5d42251ee8695fc54642dbcce0604 (patch) | |
tree | f1c2ffc21ed50d2f660cb2439e05d22d6d19a14e /src/pm-action.in | |
parent | 962304a9279c244c9cdc1328cb800dd6bd49736e (diff) |
Moved locking in pm-action.
This fixes a help-related bug that Michael Biebl noted.
Diffstat (limited to 'src/pm-action.in')
-rw-r--r-- | src/pm-action.in | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/pm-action.in b/src/pm-action.in index a6ea68c..204c0e5 100644 --- a/src/pm-action.in +++ b/src/pm-action.in @@ -42,6 +42,11 @@ if [ "$(id -u)" != "0" ]; then echo This utility may only be run by the root user. 1>&2 exit 1 fi +# +take_suspend_lock || exit 1 + +# make sure we release the lock no matter how we exit +trap remove_suspend_lock 0 # Save the command line options for the hooks while [ $# -gt 0 ] @@ -61,10 +66,6 @@ case "$ACTION" in esac "check_$ACTION" || { echo "System does not support $ACTION sleep."; exit 1; } -take_suspend_lock || exit 1 - -# make sure we release the lock no matter how we exit -trap remove_suspend_lock 0 init_logfile "${PM_LOGFILE}" # Make sure we are not inhibited before we start. |