Anonymous avatar Anonymous committed dae6d8e

Fix a mistake in kqueue 'overflow' handling.
If there is no space in the output buffer to report an
error adding to the kqueue, kevent(2) will abort and
return the error in errno (I was correct that it does
not tell you where it failed). So do not abort the loop
if kevent(2) fails and do not log (expected) EBADF.

Comments (0)

Files changed (1)


 				ret = kevent(kq, kqlst + i, 1, NULL, 0, &zero_timespec);
 				/* jdc -- someone needs to do error checking... */
-				if(ret == -1)
-				{
+				/* EBADF is normal here -- jilles */
+				if(ret == -1 && errno != EBADF)
 					rb_lib_log("kq_update_events(): kevent(): %s", strerror(errno));
-					kqoff = 0;
-					return;
-				}
 			kqoff = 0;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.