[PATCH 08/10] hal: Clean up scripts in tools

Victor Lowther victor.lowther at gmail.com
Tue Mar 25 18:48:58 PDT 2008


Minor cleanup of hal-system-set-power-save

Instead of using if [ ]; then  ... to check the return value
of the previous command, just chain with &&.
---
 tools/hal-system-power-set-power-save |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/tools/hal-system-power-set-power-save b/tools/hal-system-power-set-power-save
index bdc4962..e745c7b 100755
--- a/tools/hal-system-power-set-power-save
+++ b/tools/hal-system-power-set-power-save
@@ -5,7 +5,6 @@
 read value
 
 hal_check_priv org.freedesktop.hal.power-management.set-powersave
-hal_call_backend $value
-if [ "$?" = "0" ]; then
-    hal-set-property --udi $UDI --key "power_management.is_powersave_set" --bool "$value"
-fi
+hal_call_backend $value && \
+	hal-set-property --udi $UDI --key "power_management.is_powersave_set" \
+	--bool "$value"
-- 
1.5.4.3



More information about the hal mailing list