From eb0c2bbbaf0722103124a589e3dfe952c2664cbb Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Mon, 25 Jan 2021 13:57:08 +0000 Subject: 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. --- libbb/read.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'libbb') diff --git a/libbb/read.c b/libbb/read.c index 2e4317cd5..a342506a8 100644 --- a/libbb/read.c +++ b/libbb/read.c @@ -73,14 +73,7 @@ ssize_t FAST_FUNC read_close(int fd, void *buf, size_t size) ssize_t FAST_FUNC open_read_close(const char *filename, void *buf, size_t size) { -#if !ENABLE_PLATFORM_MINGW32 int fd = open(filename, O_RDONLY); -#else - int fd, flag; - - flag = O_RDONLY | (get_dev_type(filename) == DEV_URANDOM ? O_SPECIAL : 0); - fd = mingw_open(filename, flag); -#endif if (fd < 0) return fd; return read_close(fd, buf, size); -- cgit v1.2.3-55-g6feb