1 #include <limits.h> 2 #include <stdlib.h> 3 #include <old_tmpdir.h> 4 5 static char *fifofile; 6 get_caps_fifo(void)7static const char *get_caps_fifo(void) 8 { 9 if (!fifofile) { 10 fifofile = getenv("FIFOFILE"); 11 12 if (!fifofile) { 13 const char *tmpdir = tst_get_tmpdir_root(); 14 15 fifofile = malloc(PATH_MAX); 16 snprintf(fifofile, PATH_MAX, "%s/caps_fifo", tmpdir); 17 } 18 } 19 20 return fifofile; 21 } 22