*: 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

@ -41,12 +41,10 @@ static void convert(char *fn, int conv_type)
fstat(fileno(in), &st);
temp_fn = xasprintf("%sXXXXXX", resolved_fn);
i = mkstemp(temp_fn);
if (i == -1
|| fchmod(i, st.st_mode) == -1
) {
i = xmkstemp(temp_fn);
if (fchmod(i, st.st_mode) == -1)
bb_simple_perror_msg_and_die(temp_fn);
}
out = xfdopen_for_write(i);
}