From c532deba4a8020a8e777eaa6e205133c8c169c4a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 30 Dec 2016 12:31:17 -0400 Subject: refactor --- Command/EnableTor.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'Command') diff --git a/Command/EnableTor.hs b/Command/EnableTor.hs index 27e57d649..7af627725 100644 --- a/Command/EnableTor.hs +++ b/Command/EnableTor.hs @@ -12,6 +12,7 @@ module Command.EnableTor where import Command import qualified Annex import P2P.Address +import P2P.Annex import Utility.Tor import Annex.UUID import Config.Files @@ -105,10 +106,8 @@ checkHiddenService = bracket setup cleanup go startlistener = do r <- Annex.gitRepo u <- getUUID - uid <- liftIO getRealUserID - let ident = fromUUID u - v <- liftIO $ getHiddenServiceSocketFile torAppName uid ident - case v of + msock <- torSocketFile + case msock of Just sockfile -> ifM (liftIO $ haslistener sockfile) ( liftIO $ async $ return () , liftIO $ async $ runlistener sockfile u r -- cgit v1.2.3