diff --git a/git-compat-util.h b/git-compat-util.h
index 362e040f52cf8df17811ae95e46f0b60d2b6f071..ca0a597a282328bff9e0e29fd3653dbd656489fb 100644 (file)
--- a/git-compat-util.h
+++ b/git-compat-util.h
return stream;
}
+static inline int xmkstemp(char *template)
+{
+ int fd;
+
+ fd = mkstemp(template);
+ if (fd < 0)
+ die("Unable to create temporary file: %s", strerror(errno));
+ return fd;
+}
+
static inline size_t xsize_t(off_t len)
{
return (size_t)len;