diff options
author | Mateusz Guzik <mjg@FreeBSD.org> | 2022-08-18 21:23:53 +0000 |
---|---|---|
committer | Mateusz Guzik <mjg@FreeBSD.org> | 2022-08-18 21:23:53 +0000 |
commit | 545db925c3d5408e71e21432895770cd49fd2cf3 (patch) | |
tree | 180a13d691ac4e7adcacdc1f67493a87873a7840 | |
parent | 8d371164898141673ad3bfe6ee771931569e07d2 (diff) | |
download | src-545db925c3d5408e71e21432895770cd49fd2cf3.tar.gz src-545db925c3d5408e71e21432895770cd49fd2cf3.zip |
pipe: fix EOF case for non-blocking fds
In particular unbreaks 'go build'.
-rw-r--r-- | sys/kern/sys_pipe.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index f9060ba2c8a6..67c340e9d39a 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -734,9 +734,8 @@ pipe_read(struct file *fp, struct uio *uio, struct ucred *active_cred, if ((fp->f_flag & FNONBLOCK) != 0 && !mac_pipe_check_read_enabled()) { if (__predict_false(uio->uio_resid == 0)) return (0); - if ((atomic_load_short(&rpipe->pipe_state) & PIPE_EOF) != 0) - return (0); - if (atomic_load_int(&rpipe->pipe_buffer.cnt) == 0 && + if ((atomic_load_short(&rpipe->pipe_state) & PIPE_EOF) == 0 && + atomic_load_int(&rpipe->pipe_buffer.cnt) == 0 && atomic_load_int(&rpipe->pipe_pages.cnt) == 0) return (EAGAIN); } |