X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Fstdio%2F__stdio_read.c;h=6cd7b0733a85a3e83deb5c14ed1f6616888d3480;hb=41421d6beb3f17aa8838f7cdaad9cd16b4c451f6;hp=c99ca9a913314bdb15c221943327a39e50dc2a75;hpb=3f25354e624361f40011b242c492c2118184cc44;p=musl diff --git a/src/stdio/__stdio_read.c b/src/stdio/__stdio_read.c index c99ca9a9..6cd7b073 100644 --- a/src/stdio/__stdio_read.c +++ b/src/stdio/__stdio_read.c @@ -1,4 +1,5 @@ #include "stdio_impl.h" +#include #include static void cleanup(void *p) @@ -15,13 +16,9 @@ size_t __stdio_read(FILE *f, unsigned char *buf, size_t len) }; ssize_t cnt; - if (libc.main_thread) { - pthread_cleanup_push(cleanup, f); - cnt = syscall_cp(SYS_readv, f->fd, iov, 2); - pthread_cleanup_pop(0); - } else { - cnt = syscall(SYS_readv, f->fd, iov, 2); - } + pthread_cleanup_push(cleanup, f); + cnt = syscall_cp(SYS_readv, f->fd, iov, 2); + pthread_cleanup_pop(0); if (cnt <= 0) { f->flags |= F_EOF ^ ((F_ERR^F_EOF) & cnt); f->rpos = f->rend = 0;