aboutsummaryrefslogtreecommitdiff
path: root/src/safe.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/safe.c')
-rw-r--r--src/safe.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/safe.c b/src/safe.c
index fd7a1af..0701939 100644
--- a/src/safe.c
+++ b/src/safe.c
@@ -88,3 +88,11 @@ int mos_safe_pipe_fn(int fd[2], MosSafeErrInfo info) {
ERR_MESS("failed to pipe");
exit(EXIT_FAILURE);
}
+
+int mos_safe_mkstemp_fn(char *path, MosSafeErrInfo info) {
+ int fd = mkstemp(path);
+ if (fd != -1)
+ return fd;
+ ERR_MESS("failed to make temporary file");
+ exit(EXIT_FAILURE);
+}