diff options
author | joe <joe@jerkface.net> | 2013-11-09 21:21:47 -0500 |
---|---|---|
committer | joe <joe@jerkface.net> | 2013-11-11 16:00:25 -0500 |
commit | 75be0db86119a91a1362a9680bb79d8a44adb18c (patch) | |
tree | 972e3cc98973f3ebf7db6b038961956cb3d7b6ed | |
parent | 9732dffeb1c105b8de55656c305480cbbb761a07 (diff) |
Obtain utmp path from paths.h header.
-rw-r--r-- | Presence/Paths.hs | 33 | ||||
-rw-r--r-- | Presence/UTmp.hs | 3 |
2 files changed, 35 insertions, 1 deletions
diff --git a/Presence/Paths.hs b/Presence/Paths.hs new file mode 100644 index 00000000..ac7c0938 --- /dev/null +++ b/Presence/Paths.hs | |||
@@ -0,0 +1,33 @@ | |||
1 | {-# LANGUAGE CPP #-} | ||
2 | module Paths where | ||
3 | |||
4 | #include <paths.h> | ||
5 | |||
6 | bshell = _PATH_BSHELL | ||
7 | console = _PATH_CONSOLE | ||
8 | cshell = _PATH_CSHELL | ||
9 | devdb = _PATH_DEVDB | ||
10 | devnull = _PATH_DEVNULL | ||
11 | drum = _PATH_DRUM | ||
12 | gshadow = _PATH_GSHADOW | ||
13 | klog = _PATH_KLOG | ||
14 | kmem = _PATH_KMEM | ||
15 | lastlog = _PATH_LASTLOG | ||
16 | maildir = _PATH_MAILDIR | ||
17 | man = _PATH_MAN | ||
18 | mem = _PATH_MEM | ||
19 | mnttab = _PATH_MNTTAB | ||
20 | mounted = _PATH_MOUNTED | ||
21 | nologin = _PATH_NOLOGIN | ||
22 | preserve = _PATH_PRESERVE | ||
23 | rwhodir = _PATH_RWHODIR | ||
24 | sendmail = _PATH_SENDMAIL | ||
25 | shadow = _PATH_SHADOW | ||
26 | shells = _PATH_SHELLS | ||
27 | tty = _PATH_TTY | ||
28 | unix = _PATH_UNIX | ||
29 | utmp = _PATH_UTMP | ||
30 | vi = _PATH_VI | ||
31 | wtmp = _PATH_WTMP | ||
32 | |||
33 | |||
diff --git a/Presence/UTmp.hs b/Presence/UTmp.hs index 898e05e0..a3adaeee 100644 --- a/Presence/UTmp.hs +++ b/Presence/UTmp.hs | |||
@@ -21,9 +21,10 @@ import Data.Word | |||
21 | import Data.Int | 21 | import Data.Int |
22 | import Control.Monad.Error.Class | 22 | import Control.Monad.Error.Class |
23 | import System.IO.Error | 23 | import System.IO.Error |
24 | import qualified Paths | ||
24 | 25 | ||
25 | 26 | ||
26 | utmp_file = "/var/run/utmp" | 27 | utmp_file = Paths.utmp -- "/var/run/utmp" |
27 | 28 | ||
28 | utmp_bs = S.readFile utmp_file | 29 | utmp_bs = S.readFile utmp_file |
29 | 30 | ||