[gnome-settings-daemon] power: Fix error handling path in wait loops



commit 97383f1fdebfe32899893d5dada96d83645eab03
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Apr 17 10:52:41 2013 +0200

    power: Fix error handling path in wait loops
    
    When checking the session or logind output, we shouldn't silently
    succeed when there's an IOError.
    
    This doesn't have an impact on reading the session log, but all
    the check_for_suspend() tests fail, and check_no_suspend() will
    obviously always succeed.

 plugins/power/test.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/plugins/power/test.py b/plugins/power/test.py
index e719f07..b766f7e 100755
--- a/plugins/power/test.py
+++ b/plugins/power/test.py
@@ -197,7 +197,7 @@ class PowerPluginTest(gsdtestcase.GSDTestCase):
             try:
                 log = self.session_log.read()
             except IOError:
-                break
+                continue
 
             if log and (b'GsmManager: requesting logout' in log):
                 break
@@ -227,7 +227,7 @@ class PowerPluginTest(gsdtestcase.GSDTestCase):
             try:
                 log = self.logind.stdout.read()
             except IOError:
-                break
+                continue
 
             if log and (b' Suspend ' in log or b' Hibernate ' in log):
                 break


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]