summaryrefslogtreecommitdiffstats
path: root/test/tmpf.h
diff options
context:
space:
mode:
authorAndrew Jeffery <andrew@aj.id.au>2018-02-26 13:24:52 +1030
committerAndrew Jeffery <andrew@aj.id.au>2018-03-19 10:55:33 +1030
commitc3144042b9f050c3d880f4ae5464a2a21617fe7d (patch)
tree6567b6c7fee4aaebb5cfc939601daf43477ddad5 /test/tmpf.h
parentbaea36d912053f0945ba529e5503a6c5471e802b (diff)
downloadphosphor-mboxd-c3144042b9f050c3d880f4ae5464a2a21617fe7d.tar.gz
phosphor-mboxd-c3144042b9f050c3d880f4ae5464a2a21617fe7d.zip
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>
Diffstat (limited to 'test/tmpf.h')
-rw-r--r--test/tmpf.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/tmpf.h b/test/tmpf.h
index ce47191..cb1bda4 100644
--- a/test/tmpf.h
+++ b/test/tmpf.h
@@ -27,8 +27,20 @@ struct tmpf {
char path[PATH_MAX];
};
+/**
+ * Initialise a tmpf instance for use, creating a temporary file.
+ *
+ * @tmpf: A context to initialise with the provided template
+ * @template_str: A file basename in mkstemp(3) template form
+ *
+ * Returns 0 on success, or -1 on error with errno set appropriately
+ */
int tmpf_init(struct tmpf *tmpf, const char *template_str);
+/**
+ * Destroy a tmpf instance, closing the file descriptor and removing the
+ * temporary file.
+ */
void tmpf_destroy(struct tmpf *tmpf);
#endif /* MBOX_TEST_UTILS_H */
OpenPOWER on IntegriCloud