wineconsole: Wait on events in curses backend using select instead of poll
Martin Storsjö
martin at martin.st
Sat Nov 29 11:52:08 CST 2008
Hi Kirill,
On Sat, 29 Nov 2008, Kirill K. Smirnov wrote:
>> + ret = select(pipefd + 1, &readfds, &writefds, &errorfds, NULL);
> Passing NULL instead of &writefds in this case is better, IMO. It is not used
> anyway.
Ok
> I strongly believe that errorfds parameter os select() is useful for sockets
> only, not for stdio (I am not sure whether it is true for Darwin). Please,
> check this.
Yes, that seems to be the case on Linux at least, but I didn't really find
any definitive on the issue on Darwin. However, an error on the fd should
trigger it in readfds anyway, so I guess errorfds can be removed
completely.
In the patch, I had also forgotten to add proper includes for select, but
it worked fine on both Linux and Darwin using the existing includes. The
linux manpage says this about the include:
/* According to POSIX.1-2001 */
#include <sys/select.h>
/* According to earlier standards */
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
The BSD based manpage in Darwin only mentions sys/select.h. Should I add a
check for sys/select.h in the configure script and conditionally included
it, surrounded by HAVE_SYS_SELECT_H? Or would sys/time.h, sys/types.h and
unistd.h be enough to consider it reasonably compatible?
After fixing this, I guess I should just submit a new patch against the
current upstream git (not against the old patched version), with the same
commit message, replacing the old one?
// Martin
More information about the wine-devel
mailing list