aboutsummaryrefslogtreecommitdiff
path: root/coreutils/dos2unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/dos2unix.c')
-rw-r--r--coreutils/dos2unix.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/coreutils/dos2unix.c b/coreutils/dos2unix.c
index 8aa1d93b5..35fa11247 100644
--- a/coreutils/dos2unix.c
+++ b/coreutils/dos2unix.c
@@ -41,14 +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 (!ENABLE_PLATFORM_MINGW32 && fchmod(i, st.st_mode) == -1)
46#if !ENABLE_PLATFORM_MINGW32
47 || fchmod(i, st.st_mode) == -1
48#endif
49 ) {
50 bb_simple_perror_msg_and_die(temp_fn); 46 bb_simple_perror_msg_and_die(temp_fn);
51 } 47
52 out = xfdopen_for_write(i); 48 out = xfdopen_for_write(i);
53 } 49 }
54 50