summaryrefslogtreecommitdiff
path: root/pm
diff options
context:
space:
mode:
authorVictor Lowther <victor.lowther@gmail.com>2008-03-16 11:24:55 -0500
committerVictor Lowther <victor.lowther@gmail.com>2008-03-16 11:24:55 -0500
commit4fe96950186e616db17767ce78690f7b82231a51 (patch)
treed85dcfb8055b79e994fb629be0649d682f8f862f /pm
parent1de164bdd3915e7c93329a9df77064ed7b402ea1 (diff)
Fix bug where pm-is-supported could only be run as root.
Now we only parse the blacklist and the default parameters when we are taking the suspend lock.
Diffstat (limited to 'pm')
-rw-r--r--pm/pm-functions.in11
1 files changed, 8 insertions, 3 deletions
diff --git a/pm/pm-functions.in b/pm/pm-functions.in
index 1e86739..c14e534 100644
--- a/pm/pm-functions.in
+++ b/pm/pm-functions.in
@@ -48,9 +48,10 @@ for cfg in "${PM_UTILS_ETCDIR}"/config.d/*[!~] ; do
done
. "${PM_FUNCTIONS}"
-mkdir -p "$STORAGEDIR"
-[ -f "$PM_UTILS_ETCDIR/blacklist" ] && {
+load_hook_blacklist()
+{
+ [ -f "$PM_UTILS_ETCDIR/blacklist" ] || return
# loop through the blacklist file, adding entries to our hook blacklist.
# Blacklist file format:
# name debugging text
@@ -63,7 +64,9 @@ mkdir -p "$STORAGEDIR"
done
}
-[ -f "$PM_UTILS_ETCDIR/parameters" ] && {
+load_hook_parameters()
+{
+ [ -f "$PM_UTILS_ETCDIR/parameters" ] || return
# loop through the parameters file, and add each line in it to the
# end of PM_CMDLINE.
# Comments begin with hashmarks and run to the end of the line.
@@ -82,6 +85,8 @@ take_suspend_lock()
{
try_lock "pm-utils.lock" || return 1
mkdir -p "${STORAGEDIR}"
+ load_hook_blacklist
+ load_hook_parameters
return 0
}