From 4a6216534ca8344de988ae1644e339b9c76276fa Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Thu, 28 Jun 2012 10:55:46 -0400 Subject: [PATCH] rtems test harness setup to create temp files Apparently the default location for tmp files doesn't exist in the default IMFS tree. --- src/ioc/db/test/rtemsTestHarness.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/ioc/db/test/rtemsTestHarness.c b/src/ioc/db/test/rtemsTestHarness.c index c9ab2a68c..c72122b67 100644 --- a/src/ioc/db/test/rtemsTestHarness.c +++ b/src/ioc/db/test/rtemsTestHarness.c @@ -5,10 +5,32 @@ * in file LICENSE that is included with this distribution. \*************************************************************************/ + +#ifdef __rtems__ + +#include +#include +#include +#include + +#endif /* __rtems__ */ + extern void epicsRunDbTests(void); int main(int argc, char **argv) { +#ifdef __rtems__ + struct stat s; + printf("Try to create /tmp\n"); + umask(0); + if(mkdir("/tmp", 0777)!=0) + perror("Can't create /tmp"); + if(stat("/tmp", &s)==0) { + printf("Stat /tmp: %o %u,%u\n", s.st_mode, s.st_uid, s.st_gid); + } + epicsEnvSet("TMPDIR","/tmp"); +#endif + epicsRunDbTests(); /* calls epicsExit(0) */ return 0; }