X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=libbb%2Fxfuncs_printf.c;h=56ee459e45ffa4549692642646f7207ac19de5ce;hb=4c46d854690595bb2c5487aedccebab8de8aafda;hp=c6db38d3375d07b1dc05a27ceffb4fd798bf1f6a;hpb=8d3e225a2d1d980bcedb825f294b6a8041fe3f1b;p=oweals%2Fbusybox.git diff --git a/libbb/xfuncs_printf.c b/libbb/xfuncs_printf.c index c6db38d33..56ee459e4 100644 --- a/libbb/xfuncs_printf.c +++ b/libbb/xfuncs_printf.c @@ -134,7 +134,7 @@ int FAST_FUNC xopen3(const char *pathname, int flags, int mode) 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); @@ -240,6 +240,14 @@ off_t FAST_FUNC xlseek(int fd, off_t offset, int whence) 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) {