[prev in list] [next in list] [prev in thread] [next in thread]
List: freedesktop-pm-utils
Subject: [Pm-utils] [PATCH 1/4] Add a missing closing bracket in 99video
From: "Michael Biebl" <mbiebl () gmail ! com>
Date: 2008-02-14 15:58:08
Message-ID: aa76cdac0802140758j669e7babwc62d42206365f160 () mail ! gmail ! com
[Download RAW message or body]
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
--
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
["0001-Add-a-missing-closing-bracket-in-99video-and-apply-a.patch" (text/x-c)]
From 7d3aed8c0a0ee38903dcffa77ad19883afbf1ad4 Mon Sep 17 00:00:00 2001
From: Michael Biebl <mbiebl@gmail.com>
Date: Thu, 14 Feb 2008 16:17:09 +0100
Subject: [PATCH] Add a missing closing bracket in 99video and apply a consistend style for
opening/closing brackets.
---
pm/functions.in | 12 ++++++++----
pm/module.d/kernel | 9 ++++++---
pm/module.d/tuxonice | 18 ++++++++++++------
pm/module.d/uswsusp | 9 ++++++---
pm/sleep.d/10NetworkManager | 6 ++++--
pm/sleep.d/90clock | 6 ++++--
pm/sleep.d/99video | 14 ++++++++++----
src/pm-action.in | 3 ++-
src/pm-is-supported.in | 3 ++-
9 files changed, 54 insertions(+), 26 deletions(-)
diff --git a/pm/functions.in b/pm/functions.in
index 36559fb..cf98e08 100644
--- a/pm/functions.in
+++ b/pm/functions.in
@@ -112,7 +112,8 @@ command_exists()
return $?
}
-run_hooks() {
+run_hooks()
+{
# $1 = type of hook to find.
# $2 = paramaters to pass to hooks.
# $3 = if present and equal to "reverse", run hooks backwards.
@@ -171,7 +172,8 @@ get_power_status()
. "${SLEEP_FUNCTIONS}"
-init_logfile() {
+init_logfile()
+{
if [ -h "$1" ]; then
echo "$1 is a symbolic link, refusing to overwrite."
return 1
@@ -206,7 +208,8 @@ pm_main()
return 0
}
-_rmmod() {
+_rmmod()
+{
if modprobe -r "$1"; then
touch "${STORAGEDIR}/module:$1"
return 0
@@ -260,7 +263,8 @@ modreload()
}
if ! command_exists service; then
- service() {
+ service()
+ {
if [ -x "/etc/init.d/$1" ]; then
svc="$1"
shift
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
diff --git a/pm/sleep.d/10NetworkManager b/pm/sleep.d/10NetworkManager
index d1ad677..1116609 100755
--- a/pm/sleep.d/10NetworkManager
+++ b/pm/sleep.d/10NetworkManager
@@ -4,7 +4,8 @@
command_exists dbus-send || exit 1
-suspend_nm() {
+suspend_nm()
+{
# Tell NetworkManager to shut down networking
dbus-send --system \
--dest=org.freedesktop.NetworkManager \
@@ -12,7 +13,8 @@ suspend_nm() {
org.freedesktop.NetworkManager.sleep
}
-resume_nm() {
+resume_nm()
+{
# Wake up NetworkManager and make it do a new connection
dbus-send --system \
--dest=org.freedesktop.NetworkManager \
diff --git a/pm/sleep.d/90clock b/pm/sleep.d/90clock
index 4e6478e..de27a16 100755
--- a/pm/sleep.d/90clock
+++ b/pm/sleep.d/90clock
@@ -3,7 +3,8 @@
NTPD_LOCK="pm-ntpd.lock"
-suspend_clock() {
+suspend_clock()
+{
if try_lock "${NTPD_LOCK}"; then
trap 'release_lock "${NTPD_LOCK}"' 0
stopservice ntpd
@@ -11,7 +12,8 @@ suspend_clock() {
/sbin/hwclock --systohc >/dev/null 2>&1 0<&1
}
-resume_clock() {
+resume_clock()
+{
/sbin/hwclock --hctosys >/dev/null 2>&1 0<&1
rc=$?
# Bring back ntpd _after_ NetworkManager and such come back...
diff --git a/pm/sleep.d/99video b/pm/sleep.d/99video
index e0e48c7..b54a7d1 100755
--- a/pm/sleep.d/99video
+++ b/pm/sleep.d/99video
@@ -9,7 +9,8 @@
. "${PM_FUNCTIONS}"
-reset_brightness() {
+reset_brightness()
+{
for bl in /sys/class/backlight/* ; do
[ -f "$bl/brightness" ] || continue
BR="$(cat $bl/brightness)"
@@ -30,18 +31,21 @@ else
radeon() { echo "radeontool not found" 1>&2; return 1; }
fi
-save_fbcon(){
+save_fbcon()
+{
local con
for con in /sys/class/graphics/*/state; do
echo 1 >"${con}"
done
}
-resume_fbcon(){
+resume_fbcon()
+{
local con
for con in /sys/class/graphics/*/state; do
echo 0 >"${con}"
done
+}
resume_video()
{
@@ -72,7 +76,9 @@ resume_video()
case "$1" in
- suspend) save_fbcon ;;
+ suspend)
+ save_fbcon
+ ;;
resume)
resume_video
;;
diff --git a/src/pm-action.in b/src/pm-action.in
index 5694651..0987102 100644
--- a/src/pm-action.in
+++ b/src/pm-action.in
@@ -26,7 +26,8 @@
# The rule here? Simplicity.
-help_options() {
+help_options()
+{
echo "${0##*/} [options]"
echo
echo "Options can change how the supend or hibernate is done."
diff --git a/src/pm-is-supported.in b/src/pm-is-supported.in
index 62947f7..9e72f9f 100644
--- a/src/pm-is-supported.in
+++ b/src/pm-is-supported.in
@@ -18,7 +18,8 @@
. "@PM-UTILS-LIBDIR@/functions"
-help_options() {
+help_options()
+{
echo "pm-is-supported [--suspend | --hibernate | --suspend-hybrid ]"
echo
}
--
1.5.4.1
_______________________________________________
Pm-utils mailing list
Pm-utils@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pm-utils
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic