remove wrap_write helper from vdprintf
authorRich Felker <dalias@aerifal.cx>
Sat, 22 Feb 2020 04:44:20 +0000 (23:44 -0500)
committerRich Felker <dalias@aerifal.cx>
Sat, 22 Feb 2020 04:44:20 +0000 (23:44 -0500)
this reverts commit 4ee039f3545976f9e3e25a7e5d7b58f1f2316dc3, which
added the helper as a hack to make vdprintf usable before relocation,
contingent on strong assumptions about the arch and tooling, back when
the dynamic linker did not have a real staged model for
self-relocation. since commit f3ddd173806fd5c60b3f034528ca24542aecc5b9
this has been unnecessary and the function was just wasting size and
execution time.

src/stdio/vdprintf.c

index c35d9b4fb0412fdefb2f4a07c198b8de8b451871..3b9c093bdab85535852bffa3673a821f921ef48f 100644 (file)
@@ -1,14 +1,9 @@
 #include "stdio_impl.h"
 
-static size_t wrap_write(FILE *f, const unsigned char *buf, size_t len)
-{
-       return __stdio_write(f, buf, len);
-}
-
 int vdprintf(int fd, const char *restrict fmt, va_list ap)
 {
        FILE f = {
-               .fd = fd, .lbf = EOF, .write = wrap_write,
+               .fd = fd, .lbf = EOF, .write = __stdio_write,
                .buf = (void *)fmt, .buf_size = 0,
                .lock = -1
        };