summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Lowther <victor.lowther@gmail.com>2009-05-06 18:34:11 -0500
committerVictor Lowther <victor.lowther@gmail.com>2009-05-06 18:34:11 -0500
commitf66326636dd93afc115c64fc3320a6c2ef424a22 (patch)
treed0f410156d39212960346f4d1ff4c076cdb51c96
parent2daad8297459f68fc5ad0fd4b0a2aa8ba918621d (diff)
Update places where we check for booleans to use is_set
Suprisingly, there are not that many.
-rw-r--r--pm/pm-functions.in2
-rwxr-xr-xpm/sleep.d/90clock2
-rwxr-xr-xpm/sleep.d/99video8
3 files changed, 6 insertions, 6 deletions
diff --git a/pm/pm-functions.in b/pm/pm-functions.in
index 8ba975c..67910ea 100644
--- a/pm/pm-functions.in
+++ b/pm/pm-functions.in
@@ -89,7 +89,7 @@ fi
# We do it this way because 'echo -n' is not posix.
log()
{
- [ $LOGGING ] || return 0;
+ is_set "$LOGGING" || return 0;
local fmt='%s\n'
[ "$1" = "-n" ] && { fmt='%s'; shift; }
printf "$fmt" "$*"
diff --git a/pm/sleep.d/90clock b/pm/sleep.d/90clock
index 5df6e8e..fb8ef44 100755
--- a/pm/sleep.d/90clock
+++ b/pm/sleep.d/90clock
@@ -15,7 +15,7 @@ resume_clock()
/sbin/hwclock --hctosys >/dev/null 2>&1 0<&1
}
-[ "$NEED_CLOCK_SYNC" ] || exit $NA
+is_set "$NEED_CLOCK_SYNC" || exit $NA
case "$1" in
hibernate|suspend) suspend_clock ;;
diff --git a/pm/sleep.d/99video b/pm/sleep.d/99video
index 23e56ef..957cbc2 100755
--- a/pm/sleep.d/99video
+++ b/pm/sleep.d/99video
@@ -85,7 +85,7 @@ resume_fbcon()
maybe_chvt()
{
- [ "$QUIRK_NO_CHVT" = "true" ] && return
+ is_set "$QUIRK_NO_CHVT" && return
fgconsole |savestate console
chvt 63
}
@@ -98,7 +98,7 @@ maybe_deallocvt()
}
# Some tiny helper functions for quirk handling
-quirk() { [ "$1" = "true" ] && [ -z $QUIRK_NONE ]; }
+quirk() { is_set "$1" && [ -z $QUIRK_NONE ]; }
# save/restore vbe state
vbe_savestate() { vbe vbestate save |savestate vbestate; }
@@ -204,13 +204,13 @@ help() {
case "$1" in
suspend) maybe_chvt; suspend_video ;;
hibernate) maybe_chvt
- if [ "$HIBERNATE_RESUME_POST_VIDEO" = "yes" ]; then
+ if is_set "$HIBERNATE_RESUME_POST_VIDEO"; then
suspend_video
fi
;;
resume) resume_video; maybe_deallocvt;;
thaw)
- if [ "${HIBERNATE_RESUME_POST_VIDEO}" = "yes" ]; then
+ if is_set "${HIBERNATE_RESUME_POST_VIDEO}"; then
resume_video
fi
maybe_deallocvt