summaryrefslogtreecommitdiff
path: root/pm/functions.in
diff options
context:
space:
mode:
authorVictor Lowther <victor.lowther@gmail.com>2008-03-01 18:09:53 -0600
committerVictor Lowther <victor.lowther@gmail.com>2008-03-01 18:09:53 -0600
commit9022cb6113a910ae559cbb3a3833f07107df400d (patch)
tree136fcfb14cdbec772a384cb64fd2dc168fcd0cf4 /pm/functions.in
parentf33864caecfea67be95abf0719e96861d6c243b3 (diff)
parent9343bda51f8feff514b2bd0430c6435ee7466148 (diff)
Merge branch 'master' into vlowther-move-pm-main
Conflicts: src/pm-action.in
Diffstat (limited to 'pm/functions.in')
-rw-r--r--pm/functions.in13
1 files changed, 11 insertions, 2 deletions
diff --git a/pm/functions.in b/pm/functions.in
index 2e2703b..e0fc960 100644
--- a/pm/functions.in
+++ b/pm/functions.in
@@ -25,6 +25,7 @@ TEMPORARY_CPUFREQ_GOVERNOR="performance"
LOCKDIR="${PM_UTILS_RUNDIR}/locks"
STORAGEDIR="${PM_UTILS_RUNDIR}/storage"
SLEEP_MODULE="kernel"
+NA=254
# Use c sort order
export LC_COLLATE=C
@@ -118,8 +119,15 @@ command_exists()
return $?
}
-run_hooks()
-{
+hook_exit_status(){
+ case $1 in
+ 0) echo "success." ;;
+ $NA) echo "not applicable." ;;
+ *) echo "Returned exit code $1." ;;
+ esac
+}
+
+run_hooks() {
# $1 = type of hook to find.
# $2 = paramaters to pass to hooks.
# $3 = if present and equal to "reverse", run hooks backwards.
@@ -147,6 +155,7 @@ run_hooks()
IFS="${oifs}"
echo "$(date): running ${hook} $2"
"${hook}" $2
+ hook_exit_status $?
)
done
IFS="${oifs}"