*: introduce and use xmkstemp. -65 bytes.

Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
This commit is contained in:
Alexander Shishkin
2010-10-22 13:27:16 +02:00
committed by Denys Vlasenko
parent cbfeaac7af
commit 6722737ece
7 changed files with 17 additions and 16 deletions

View File

@ -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)
{