diff options
author | Ron Yorston <rmy@pobox.com> | 2021-01-24 12:41:19 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2021-01-24 13:07:11 +0000 |
commit | 6422b0ef38d0835c86b40e6e642f18cdfb933e85 (patch) | |
tree | 4e235a00fe2f61e7c4466272b52b943e9117270a /libbb | |
parent | 3c85cc0c4821f7131d90f5010b2930bdb0eae4d4 (diff) | |
download | busybox-w32-6422b0ef38d0835c86b40e6e642f18cdfb933e85.tar.gz busybox-w32-6422b0ef38d0835c86b40e6e642f18cdfb933e85.tar.bz2 busybox-w32-6422b0ef38d0835c86b40e6e642f18cdfb933e85.zip |
tls: avoid unnecessary changes to POSIX build
Calls to tls_error_die() embed the line number of the error in the
binary. Since some lines had been added to tls.c for the WIN32
port a POSIX build of the busybox-w32 source differed from upstream.
Avoid this by pushing the special handling of /dev/urandom down into
open_read_close(). tls.c is now unchanged from upstream.
The only differences in the POSIX build reported by 'objdump -s'
are now the GNU build id, the copyright date and the date of the
configuration.
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/read.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libbb/read.c b/libbb/read.c index a342506a8..2e4317cd5 100644 --- a/libbb/read.c +++ b/libbb/read.c | |||
@@ -73,7 +73,14 @@ ssize_t FAST_FUNC read_close(int fd, void *buf, size_t size) | |||
73 | 73 | ||
74 | ssize_t FAST_FUNC open_read_close(const char *filename, void *buf, size_t size) | 74 | ssize_t FAST_FUNC open_read_close(const char *filename, void *buf, size_t size) |
75 | { | 75 | { |
76 | #if !ENABLE_PLATFORM_MINGW32 | ||
76 | int fd = open(filename, O_RDONLY); | 77 | int fd = open(filename, O_RDONLY); |
78 | #else | ||
79 | int fd, flag; | ||
80 | |||
81 | flag = O_RDONLY | (get_dev_type(filename) == DEV_URANDOM ? O_SPECIAL : 0); | ||
82 | fd = mingw_open(filename, flag); | ||
83 | #endif | ||
77 | if (fd < 0) | 84 | if (fd < 0) |
78 | return fd; | 85 | return fd; |
79 | return read_close(fd, buf, size); | 86 | return read_close(fd, buf, size); |