diff options
author | joe <joe@jerkface.net> | 2013-07-15 13:23:31 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2013-07-15 13:23:31 -0400 |
commit | 43d147c7470edea26656987b8b16d08beae93e45 (patch) | |
tree | 3d091f33344348779c6109e64300ea70a5764816 /Presence/LocalPeerCred.hs | |
parent | 8556b4bcc0ce2b308fc9c2ec424f43feef5faa52 (diff) |
Exported ClientCommands channel to main module so that we can start
tracking clients for messaging and client status.
Diffstat (limited to 'Presence/LocalPeerCred.hs')
-rw-r--r-- | Presence/LocalPeerCred.hs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Presence/LocalPeerCred.hs b/Presence/LocalPeerCred.hs index 14f5234a..f66421f8 100644 --- a/Presence/LocalPeerCred.hs +++ b/Presence/LocalPeerCred.hs | |||
@@ -104,6 +104,9 @@ parseProcNet port host h = do | |||
104 | unmap6mapped4 addr@(SockAddrInet6 port _ (0,0,0xFFFF,a) _) = SockAddrInet port (toBE32 a) | 104 | unmap6mapped4 addr@(SockAddrInet6 port _ (0,0,0xFFFF,a) _) = SockAddrInet port (toBE32 a) |
105 | unmap6mapped4 addr = addr | 105 | unmap6mapped4 addr = addr |
106 | 106 | ||
107 | identifyTTY :: | ||
108 | [(W8.ByteString, ProcessID)] | ||
109 | -> UserID -> W8.ByteString -> IO (Maybe W8.ByteString, Maybe CPid) | ||
107 | identifyTTY tty_pids uid inode = do | 110 | identifyTTY tty_pids uid inode = do |
108 | pid <- scanProc (show uid) (L.unpack inode) | 111 | pid <- scanProc (show uid) (L.unpack inode) |
109 | -- putStrLn $ "scanProc --> "++show pid | 112 | -- putStrLn $ "scanProc --> "++show pid |
@@ -122,6 +125,7 @@ identifyTTY tty_pids uid inode = do | |||
122 | parseTty :: String -> Float | 125 | parseTty :: String -> Float |
123 | parseTty = read . tail . dropWhile (/=':') | 126 | parseTty = read . tail . dropWhile (/=':') |
124 | 127 | ||
128 | ttyToXorgs :: Show a => [(t, a)] -> IO [([Char], t)] | ||
125 | ttyToXorgs tty_pids = do | 129 | ttyToXorgs tty_pids = do |
126 | dts' <- flip mapM tty_pids $ \(tty,pid) -> do | 130 | dts' <- flip mapM tty_pids $ \(tty,pid) -> do |
127 | cmd' <- readFile $ "/proc/"++show pid++"/cmdline" | 131 | cmd' <- readFile $ "/proc/"++show pid++"/cmdline" |