test: Update tmpf to store data in /tmp, reformat names
Cleans up residuals from failed tests in the source tree by moving them
to /tmp. Some were annoying to remove with prefixes like 'mbox', so
change the pattern as well to include '-store'.
Change-Id: I674664a372e7e15ec4c3cd93d33318c4135f33ba
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/test/tmpf.c b/test/tmpf.c
index 285f5d5..e9cc558 100644
--- a/test/tmpf.c
+++ b/test/tmpf.c
@@ -25,9 +25,12 @@
#include "test/tmpf.h"
+static const char *tmpf_dir = "/tmp/";
+
int tmpf_init(struct tmpf *tmpf, const char *template)
{
- strncpy(tmpf->path, template, sizeof(tmpf->path) - 1);
+ strcpy(tmpf->path, tmpf_dir);
+ strncat(tmpf->path, template, sizeof(tmpf->path) - sizeof(tmpf_dir));
tmpf->fd = mkstemp(tmpf->path);
if (tmpf->fd < 0) {