Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(898)

Unified Diff: src/platform/acpi/action_lid.sh

Issue 1753012: Check for lid state being "closed" instead of not "open". (Closed) Base URL: ssh://git@chromiumos-git/chromeos
Patch Set: Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/acpi/action_lid.sh
diff --git a/src/platform/acpi/action_lid.sh b/src/platform/acpi/action_lid.sh
index d8700695f628434eda0f40672445ac65c02ca98a..7a8cf039677e13b819ce5214d8af230fad2189f2 100755
--- a/src/platform/acpi/action_lid.sh
+++ b/src/platform/acpi/action_lid.sh
@@ -4,17 +4,23 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+logger "action_lid.sh: " `cat /proc/acpi/button/lid/*/state`
+
+grep -q "closed" /proc/acpi/button/lid/*/state
+if [ $? != 0 ]; then
+ logger "action_lid.sh: lid is not closed. Bailing out."
+ exit 0
+fi
+
+
# Shutdowns instead of sleeping if no one is logged in.
if ! test -f /var/run/state/logged-in; then
+ logger "action_lid.sh: lid closed. Shutting down since no one is logged in"
shutdown -h now
exit 0
fi
-# Checks whether the lid is closed before proceeding.
-grep -q open /proc/acpi/button/lid/*/state
-if [ $? = 0 ]; then
- exit 0
-fi
+logger "action_lid.sh: lid closed. Going to suspend-to-RAM state"
# On lid close:
# - locks the screen
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698