From: Ben Gras Date: Wed, 5 Mar 2014 14:12:54 +0000 (+0100) Subject: vfs: call pipe_check before reviving select() X-Git-Tag: v3.3.0~404 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/doc/spin.js?a=commitdiff_plain;h=013226c417480e0645e83b8ca4ef7cfe64614446;p=minix.git vfs: call pipe_check before reviving select() . select callback on close() on a pipe would falsely revive a read-select on the pipe . the extra pipe_check catches it . fixes the new import of the netbsd make in -j N mode (make jobs that communicate with pipes) --- diff --git a/servers/vfs/pipe.c b/servers/vfs/pipe.c index ce0909727..f9e2c6ad6 100644 --- a/servers/vfs/pipe.c +++ b/servers/vfs/pipe.c @@ -392,7 +392,16 @@ int count; /* max number of processes to release */ if (f->filp_count < 1 || !(f->filp_pipe_select_ops & selop) || f->filp_vno != vp) continue; + + /* Do a pipe_check to see if we really want to callback this + * select; a close() doesn't always warrant it. + */ + if(pipe_check(f, op == VFS_READ ? READING : WRITING, + f->filp_flags & ~O_NONBLOCK, 1, 1) == SUSPEND) { + continue; + } select_callback(f, selop); + f->filp_pipe_select_ops &= ~selop; } }