提交 9bf9c732 编写于 作者: R Rich Felker

remove obfuscated flags bit-twiddling logic in __stdio_read

replace with simple conditional that doesn't rely on assumption that
cnt is either 0 or -1.
上级 b123f239
......@@ -11,7 +11,7 @@ size_t __stdio_read(FILE *f, unsigned char *buf, size_t len)
cnt = syscall(SYS_readv, f->fd, iov, 2);
if (cnt <= 0) {
f->flags |= F_EOF ^ ((F_ERR^F_EOF) & cnt);
f->flags |= cnt ? F_ERR : F_EOF;
return cnt;
}
if (cnt <= iov[0].iov_len) return cnt;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册