return ret;
}
-// Die if we can't open an existing file and return a fd.
+// Die if we can't open a file and return a fd.
int FAST_FUNC xopen(const char *pathname, int flags)
{
return xopen3(pathname, flags, 0666);
return off;
}
+int FAST_FUNC xmkstemp(char *template)
+{
+ int fd = mkstemp(template);
+ if (fd < 0)
+ bb_perror_msg_and_die("can't create temp file '%s'", template);
+ return fd;
+}
+
// Die with supplied filename if this FILE* has ferror set.
void FAST_FUNC die_if_ferror(FILE *fp, const char *fn)
{