summaryrefslogtreecommitdiff
path: root/src/tet3/tcm/ictp.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2010-06-30 15:08:32 +1000
committerAaron Plattner <aplattner@nvidia.com>2011-05-24 17:47:36 -0700
commit08fdfe8818e35f53f4be9b67ab0c24a6f29a58a9 (patch)
treec30456787dfb9df0a38ebefe273c070203df4008 /src/tet3/tcm/ictp.c
parent99abe6b32def53ab8b2e34ca630ffa99f230313a (diff)
tet3: if TET_RESFILE is not in the env, guess it from the program name.xts-0.99.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> [aplattner@nvidia.com: fixed whitespace to match surrounding code] Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Diffstat (limited to 'src/tet3/tcm/ictp.c')
-rw-r--r--src/tet3/tcm/ictp.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/tet3/tcm/ictp.c b/src/tet3/tcm/ictp.c
index 2940f88b..12d39186 100644
--- a/src/tet3/tcm/ictp.c
+++ b/src/tet3/tcm/ictp.c
@@ -123,6 +123,9 @@ MODIFICATIONS:
Andrew Dingwall, UniSoft Ltd., July 1998
Added support for shared API libraries.
+ Peter Hutterer, Red Hat, Inc., June 2010
+ Guess TET_RESFILE if it's not in the environment.
+
************************************************************************/
#include <stdio.h>
@@ -798,7 +801,13 @@ char *progname;
/* get results filename from the environment */
resfile = getenv("TET_RESFILE");
if (!resfile)
- fatal(0, "TET_RESFILE not set in the environment", NULL);
+ {
+ /* just assume progname.log. */
+ char *new_resfile = malloc(strlen(progname) + 5);
+ sprintf(new_resfile, "%s.log", progname);
+ resfile = new_resfile; /* XXX: leaking memory */
+ printf("TET_RESFILE not set in the environment, using '%s'.\n", resfile);
+ }
tmpresenv = malloc(strlen(tmpvar) + strlen(resfile) +
strlen("=.tmp") + 1);