* Optimize kevent() when it is called with a zero timeout.

(Credit: Eric Wong)



git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@609 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
This commit is contained in:
mheily 2012-12-24 17:19:37 +00:00
parent 21f15f32e2
commit a316fbb867
2 changed files with 4 additions and 1 deletions

View File

@ -1,6 +1,9 @@
HEAD
------------------------------------------------------------------------
* Optimize kevent() when it is called with a zero timeout.
(Credit: Eric Wong)
* Avoid calling getsockopt() on file descriptors that are not sockets.
(Credit: Eric Wong)

View File

@ -121,7 +121,7 @@ linux_kevent_wait(
int timeout, nret;
/* Use pselect() if the timeout value is less than one millisecond. */
if (ts != NULL && ts->tv_sec == 0 && ts->tv_nsec < 1000000) {
if (ts != NULL && ts->tv_sec == 0 && ts->tv_nsec > 0 && ts->tv_nsec < 1000000) {
nret = linux_kevent_wait_hires(kq, ts);
if (nret <= 0)
return (nret);