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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user