summaryrefslogtreecommitdiff
path: root/pm/module.d
diff options
context:
space:
mode:
authorMichael Biebl <mbiebl@gmail.com>2008-02-16 10:19:40 -0600
committerVictor Lowther <victor.lowther@gmail.com>2008-02-16 10:19:40 -0600
commit2b99001c87461df573cf6ae3091f88e193ede23a (patch)
tree666769c517fa442ec7ab9744076121df263668bc /pm/module.d
parent03a59b39d415366cb7068886f103db8fa6ef6aac (diff)
99video had a missing closing bracket.
While fixing that I noticed that we use an inconsistent style for function brackets. I chose foo() { } as it seemed to be the most used one. Cheers, Michael
Diffstat (limited to 'pm/module.d')
-rw-r--r--pm/module.d/kernel9
-rw-r--r--pm/module.d/tuxonice18
-rw-r--r--pm/module.d/uswsusp9
3 files changed, 24 insertions, 12 deletions
diff --git a/pm/module.d/kernel b/pm/module.d/kernel
index 7ce340d..1c0aa12 100644
--- a/pm/module.d/kernel
+++ b/pm/module.d/kernel
@@ -1,4 +1,5 @@
-check_suspend() {
+check_suspend()
+{
grep -q mem /sys/power/state
}
@@ -7,7 +8,8 @@ do_suspend()
pm-pmu --suspend || echo -n "mem" > /sys/power/state
}
-check_hibernate() {
+check_hibernate()
+{
[ -f /sys/power/disk ] && grep -q disk /sys/power/state
}
@@ -17,7 +19,8 @@ do_hibernate()
echo -n "disk" > /sys/power/state
}
-check_suspend_hybrid() {
+check_suspend_hybrid()
+{
return 1
}
diff --git a/pm/module.d/tuxonice b/pm/module.d/tuxonice
index b1397d0..79c50ac 100644
--- a/pm/module.d/tuxonice
+++ b/pm/module.d/tuxonice
@@ -9,28 +9,34 @@ for loc in "/sys/power/tuxonice" "/sys/power/suspend2"; do
[ -d "${loc}" ] && { TUXONICE_LOC="${loc}"; break; }
done
-check_suspend() {
+check_suspend()
+{
grep -q mem /sys/power/state
}
-do_suspend() {
+do_suspend()
+{
echo "mem" >/sys/power/state
}
-check_hibernate() {
+check_hibernate()
+{
[ -f "${TUXONICE_LOC}/do_hibernate" ]
}
-do_hibernate() {
+do_hibernate()
+{
echo 5 > "${TUXONICE_LOC}/powerdown_method"
echo anything > "${TUXONICE_LOC}/do_hibernate"
}
-check_suspend_hybrid() {
+check_suspend_hybrid()
+{
grep -q mem /sys/power/state && \
[ -f "${TUXONICE_LOC}/do_hibernate" ]
}
-do_suspend_hybrid() {
+do_suspend_hybrid()
+{
echo 3 >"${TUXONICE_LOC}/powerdown_method"
echo anything >"${TUXONICE_LOC}/do_hibernate"
}
diff --git a/pm/module.d/uswsusp b/pm/module.d/uswsusp
index 525aae9..468b604 100644
--- a/pm/module.d/uswsusp
+++ b/pm/module.d/uswsusp
@@ -1,4 +1,5 @@
-check_suspend() {
+check_suspend()
+{
grep -q mem /sys/power/state
}
@@ -7,7 +8,8 @@ do_suspend()
echo "mem" >/sys/power/state
}
-check_hibernate() {
+check_hibernate()
+{
[ -f /sys/power/disk ] && \
grep -q disk /sys/power/state && \
[ -c /dev/snapshot ] &&
@@ -19,7 +21,8 @@ do_hibernate()
s2disk
}
-check_suspend_hybrid() {
+check_suspend_hybrid()
+{
grep -q mem /sys/power/state && \
command_exists s2both && \
check_hibernate