rtems test harness setup to create temp files

Apparently the default location for tmp files
doesn't exist in the default IMFS tree.
This commit is contained in:
Michael Davidsaver
2012-06-28 10:55:46 -04:00
parent 39ccbeeb11
commit 4a6216534c
+22
View File
@@ -5,10 +5,32 @@
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#ifdef __rtems__
#include <stdio.h>
#include <envDefs.h>
#include <sys/stat.h>
#include <sys/types.h>
#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;
}