summaryrefslogtreecommitdiff
path: root/rts/Hpc.c
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2008-07-01 12:43:20 +0000
committerIan Lynagh <igloo@earth.li>2008-07-01 12:43:20 +0000
commit073a9255cbe13e4dfb10b6d6090e4696453c4881 (patch)
tree10fd7d77cf00b8b4e084824fc24dd19f53a412af /rts/Hpc.c
parentf976971cb3ad7cb96e28871c06cc0d47ff436ec4 (diff)
downloadhaskell-073a9255cbe13e4dfb10b6d6090e4696453c4881.tar.gz
Allow the exact HPC tix filename to be given in the HPCTIXFILE env var
Diffstat (limited to 'rts/Hpc.c')
-rw-r--r--rts/Hpc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/rts/Hpc.c b/rts/Hpc.c
index 1624079dec..a6e854ba83 100644
--- a/rts/Hpc.c
+++ b/rts/Hpc.c
@@ -174,14 +174,20 @@ readTix(void) {
static void hpc_init(void) {
char *hpc_tixdir;
+ char *hpc_tixfile;
if (hpc_inited != 0) {
return;
}
hpc_inited = 1;
hpc_pid = getpid();
hpc_tixdir = getenv("HPCTIXDIR");
+ hpc_tixfile = getenv("HPCTIXFILE");
- if (hpc_tixdir != NULL) {
+ /* XXX Check results of mallocs/strdups, and check we are requesting
+ enough bytes */
+ if (hpc_tixfile != NULL) {
+ tixFilename = strdup(hpc_tixfile);
+ } else if (hpc_tixdir != NULL) {
/* Make sure the directory is present;
* conditional code for mkdir lifted from lndir.c
*/