diff options
author | Ron Yorston <rmy@pobox.com> | 2021-01-25 13:57:08 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2021-01-25 14:15:02 +0000 |
commit | eb0c2bbbaf0722103124a589e3dfe952c2664cbb (patch) | |
tree | 3ae3ec89bd7a6041ed5aed1d537f6b2fb3586ed7 /coreutils/dd.c | |
parent | 6422b0ef38d0835c86b40e6e642f18cdfb933e85 (diff) | |
download | busybox-w32-eb0c2bbbaf0722103124a589e3dfe952c2664cbb.tar.gz busybox-w32-eb0c2bbbaf0722103124a589e3dfe952c2664cbb.tar.bz2 busybox-w32-eb0c2bbbaf0722103124a589e3dfe952c2664cbb.zip |
tls: avoid unnecessary changes to POSIX build, part 2
On reflection, the previous commit may have been ill-advised. There
are many calls to open_read_close() and most shouldn't be able to
access special devices. (Though in practice only a few are enabled
in busybox-w32.)
Nonetheless, I've implemented a new mechanism which uses the macro
MINGW_SPECIAL() to mark calls to functions that are allowed to
access special devices.
An unrelated change is to avoid compiling fputs_stdout() in
coreutils/printf.c for the POSIX build.
Diffstat (limited to 'coreutils/dd.c')
-rw-r--r-- | coreutils/dd.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/coreutils/dd.c b/coreutils/dd.c index c150ef5bc..bd799aa2b 100644 --- a/coreutils/dd.c +++ b/coreutils/dd.c | |||
@@ -505,10 +505,8 @@ int dd_main(int argc UNUSED_PARAM, char **argv) | |||
505 | if (G.flags & FLAG_IDIRECT) | 505 | if (G.flags & FLAG_IDIRECT) |
506 | iflag |= O_DIRECT; | 506 | iflag |= O_DIRECT; |
507 | #endif | 507 | #endif |
508 | #if !ENABLE_PLATFORM_MINGW32 | 508 | xmove_fd(MINGW_SPECIAL(xopen)(infile, iflag), ifd); |
509 | xmove_fd(xopen(infile, iflag), ifd); | 509 | #if ENABLE_PLATFORM_MINGW32 |
510 | #else | ||
511 | xmove_fd(mingw_xopen(infile, iflag), ifd); | ||
512 | update_dev_fd(get_dev_type(infile), ifd); | 510 | update_dev_fd(get_dev_type(infile), ifd); |
513 | #endif | 511 | #endif |
514 | } else { | 512 | } else { |