diff options
Diffstat (limited to 'coreutils/dos2unix.c')
-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 | ||