X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FHpc.c;h=a6e854ba830f0ec02c6759eb93abe5b1ebd4556d;hb=de75026f5a48d3d052135a973ab4dff76c5b20f5;hp=1624079dec78b6e5ed57a44ed05f0f90ea012dcf;hpb=f3a8297c1e3b9b5b645afdf6f3d505adbe1a19dc;p=ghc-hetmet.git diff --git a/rts/Hpc.c b/rts/Hpc.c index 1624079..a6e854b 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 */