diff options
author | Joey Hess <joey@kitenet.net> | 2012-10-26 00:02:03 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-10-26 00:02:03 -0400 |
commit | 0a87d90900949e6f7e75ab2ac83b4135746d7602 (patch) | |
tree | 9cf899ad4878c6906ecdb60d000636cb5a01ed04 /Assistant/Threads/NetWatcher.hs | |
parent | 5b10750146bc036cba2c9798803b61e69f180360 (diff) |
improved dbus error handling
Now when the dbus connection is dropped, it'll fall back to polling.
I could make it try to reconnect, but there's a FD leak in the dbus
library, so not yet.
Diffstat (limited to 'Assistant/Threads/NetWatcher.hs')
-rw-r--r-- | Assistant/Threads/NetWatcher.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Assistant/Threads/NetWatcher.hs b/Assistant/Threads/NetWatcher.hs index a8daa9435..f9ca5641d 100644 --- a/Assistant/Threads/NetWatcher.hs +++ b/Assistant/Threads/NetWatcher.hs @@ -57,7 +57,7 @@ netWatcherFallbackThread st dstatus scanremotes = thread $ #if WITH_DBUS dbusThread :: ThreadState -> DaemonStatusHandle -> ScanRemoteMap -> IO () -dbusThread st dstatus scanremotes = E.catch (go =<< connectSystem) onerr +dbusThread st dstatus scanremotes = E.catch (runClient getSystemAddress go) onerr where go client = ifM (checkNetMonitor client) ( do @@ -69,7 +69,7 @@ dbusThread st dstatus scanremotes = E.catch (go =<< connectSystem) onerr ) onerr :: E.SomeException -> IO () onerr e = runThreadState st $ - warning $ "Failed to use dbus; falling back to polling (" ++ show e ++ ")" + warning $ "dbus failed; falling back to polling (" ++ show e ++ ")" handle = do debug thisThread ["detected network connection"] handleConnection st dstatus scanremotes |