diff options
author | Alexander Shishkin <virtuoso@slind.org> | 2010-10-22 13:27:16 +0200 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2010-10-22 13:27:16 +0200 |
commit | 6722737ece4b8db3e30b53aef8f981f53db1621e (patch) | |
tree | 8e2ddb1d3a43d595ac4584e3d1ef23f49a462bf4 /coreutils | |
parent | cbfeaac7afe31323d46c52da3b98a949232d708e (diff) | |
download | busybox-w32-6722737ece4b8db3e30b53aef8f981f53db1621e.tar.gz busybox-w32-6722737ece4b8db3e30b53aef8f981f53db1621e.tar.bz2 busybox-w32-6722737ece4b8db3e30b53aef8f981f53db1621e.zip |
*: introduce and use xmkstemp. -65 bytes.
Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/dos2unix.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/coreutils/dos2unix.c b/coreutils/dos2unix.c index ba1ca8c79..eab8110dc 100644 --- a/coreutils/dos2unix.c +++ b/coreutils/dos2unix.c | |||
@@ -41,12 +41,10 @@ static void convert(char *fn, int conv_type) | |||
41 | fstat(fileno(in), &st); | 41 | fstat(fileno(in), &st); |
42 | 42 | ||
43 | temp_fn = xasprintf("%sXXXXXX", resolved_fn); | 43 | temp_fn = xasprintf("%sXXXXXX", resolved_fn); |
44 | i = mkstemp(temp_fn); | 44 | i = xmkstemp(temp_fn); |
45 | if (i == -1 | 45 | if (fchmod(i, st.st_mode) == -1) |
46 | || fchmod(i, st.st_mode) == -1 | ||
47 | ) { | ||
48 | bb_simple_perror_msg_and_die(temp_fn); | 46 | bb_simple_perror_msg_and_die(temp_fn); |
49 | } | 47 | |
50 | out = xfdopen_for_write(i); | 48 | out = xfdopen_for_write(i); |
51 | } | 49 | } |
52 | 50 | ||