Svante Signell, le Thu 22 Nov 2012 20:29:32 +0100, a écrit : > @@ -231,15 +232,21 @@ S_io_select (struct sock_user *user, > if (valid & SELECT_READ) > { > pipe_acquire_reader (read_pipe); > - if (pipe_wait_readable (read_pipe, 1, 1) != EWOULDBLOCK) > + err = pipe_wait_readable (read_pipe, 1, 1); > + if (err != EWOULDBLOCK) > ready |= SELECT_READ; /* Data immediately readable (or error). */ > + if ((err != 0) && (err != EWOULDBLOCK)) > + return err; > mutex_unlock (&read_pipe->lock);
That can not be correct, you have to release the lock before returning. About the behavior change, I'd tend to agree, but I'd rather get others' opinion too. I guess what you actually want to fix is the error case on poll()? (actually here the only error that can happen is EPIPE) (that would have saved a mail roundtrip if you had simply said so in your mail) In the poll case, we are indeed supposed to catch errors and set POLLERR in that case, which we apparently never do. I guess (again, you should have written it to save guesswork) that what you want to do is that when io_select returns an error, in the poll() case you record something so that POLLERR will eventually be set, while in the select() case you simply mark the fd as readable (since that's the expected select behavior)? Samuel