diff options
author | joe <joe@jerkface.net> | 2017-11-12 20:35:00 -0500 |
---|---|---|
committer | joe <joe@jerkface.net> | 2017-11-12 20:35:00 -0500 |
commit | 5e8f82e436c03e1c59e69d5c9eb0e5a14284dd87 (patch) | |
tree | 1f5e8816e162e570131b8f4cfd90f7cb0b4c5fa7 /Presence/ConsoleWriter.hs | |
parent | d4288f5a9f87e3889a50a347ebad0a812f52938c (diff) |
We no longer require root. (ConsoleWriter is disabled without).
Diffstat (limited to 'Presence/ConsoleWriter.hs')
-rw-r--r-- | Presence/ConsoleWriter.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Presence/ConsoleWriter.hs b/Presence/ConsoleWriter.hs index e755b27f..986294f4 100644 --- a/Presence/ConsoleWriter.hs +++ b/Presence/ConsoleWriter.hs | |||
@@ -17,7 +17,6 @@ import Data.Monoid | |||
17 | import Data.Char | 17 | import Data.Char |
18 | import Data.Maybe | 18 | import Data.Maybe |
19 | import System.Environment hiding (setEnv) | 19 | import System.Environment hiding (setEnv) |
20 | import System.Process ( rawSystem ) | ||
21 | import System.Exit ( ExitCode(ExitSuccess) ) | 20 | import System.Exit ( ExitCode(ExitSuccess) ) |
22 | import System.Posix.Env ( setEnv ) | 21 | import System.Posix.Env ( setEnv ) |
23 | import System.Posix.Process ( forkProcess, exitImmediately, executeFile ) | 22 | import System.Posix.Process ( forkProcess, exitImmediately, executeFile ) |
@@ -36,7 +35,7 @@ import qualified Data.Text as Text | |||
36 | import qualified Network.BSD as BSD | 35 | import qualified Network.BSD as BSD |
37 | 36 | ||
38 | import UTmp ( users2, utmp_file, UtmpRecord(..), UT_Type(..) ) | 37 | import UTmp ( users2, utmp_file, UtmpRecord(..), UT_Type(..) ) |
39 | import FGConsole ( monitorTTY ) | 38 | import FGConsole ( forkTTYMonitor ) |
40 | import XMPPServer ( Stanza, makePresenceStanza, JabberShow(..), stanzaType | 39 | import XMPPServer ( Stanza, makePresenceStanza, JabberShow(..), stanzaType |
41 | , LangSpecificMessage(..), msgLangMap, cloneStanza, stanzaFrom ) | 40 | , LangSpecificMessage(..), msgLangMap, cloneStanza, stanzaFrom ) |
42 | import ControlMaybe ( handleIO_ ) | 41 | import ControlMaybe ( handleIO_ ) |
@@ -109,7 +108,7 @@ onLogin cs start = \e -> do | |||
109 | -- | Sets up threads to monitor tty switches and logins that are | 108 | -- | Sets up threads to monitor tty switches and logins that are |
110 | -- written to the system utmp file and returns a 'ConsoleWriter' | 109 | -- written to the system utmp file and returns a 'ConsoleWriter' |
111 | -- object for interacting with that information. | 110 | -- object for interacting with that information. |
112 | newConsoleWriter :: IO ConsoleWriter | 111 | newConsoleWriter :: IO (Maybe ConsoleWriter) |
113 | newConsoleWriter = do | 112 | newConsoleWriter = do |
114 | chan <- atomically $ newEmptyTMVar | 113 | chan <- atomically $ newEmptyTMVar |
115 | cs <- atomically $ do | 114 | cs <- atomically $ do |
@@ -136,7 +135,8 @@ newConsoleWriter = do | |||
136 | inotify <- initINotify | 135 | inotify <- initINotify |
137 | 136 | ||
138 | -- get active tty | 137 | -- get active tty |
139 | mtty <- monitorTTY (onTTY outvar cs) | 138 | mtty <- forkTTYMonitor (onTTY outvar cs) |
139 | forM mtty $ \_ -> do | ||
140 | atomically $ retryWhen (readTVar $ csActiveTTY cs) (==0) | 140 | atomically $ retryWhen (readTVar $ csActiveTTY cs) (==0) |
141 | 141 | ||
142 | -- read utmp | 142 | -- read utmp |