[podsleuth] Fix HAL activation on startup



commit 1e61d0ba3c17c87b02cf87709693d6a62b0321b9
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Mon May 10 13:51:51 2010 -0700

    Fix HAL activation on startup

 src/PodSleuth.Hal/Hal/Manager.cs |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/PodSleuth.Hal/Hal/Manager.cs b/src/PodSleuth.Hal/Hal/Manager.cs
index 21a73f9..41afc36 100644
--- a/src/PodSleuth.Hal/Hal/Manager.cs
+++ b/src/PodSleuth.Hal/Hal/Manager.cs
@@ -94,9 +94,13 @@ namespace Hal
         {
             if (!Bus.System.NameHasOwner("org.freedesktop.Hal")) {
                 // try to start it
-                var reply = Bus.System.StartServiceByName ("org.freedesktop.Hal");
-                if (reply != StartReply.Success && reply != StartReply.AlreadyRunning) {
-                    throw new ApplicationException("Could not start org.freedesktop.Hal");
+                try {
+                    var reply = Bus.System.StartServiceByName ("org.freedesktop.Hal");
+                    if (reply != StartReply.Success && reply != StartReply.AlreadyRunning) {
+                        return false;
+                    }
+                } catch (Exception) {
+                    return false;
                 }
 
                 // If still not started, we're done



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