ext/libev/ev_kqueue.c in polyphony-0.19 vs ext/libev/ev_kqueue.c in polyphony-0.20

- old
+ new

@@ -1,9 +1,9 @@ /* * libev kqueue backend * - * Copyright (c) 2007,2008,2009,2010,2011,2012,2013 Marc Alexander Lehmann <libev@schmorp.de> + * Copyright (c) 2007,2008,2009,2010,2011,2012,2013,2016,2019 Marc Alexander Lehmann <libev@schmorp.de> * All rights reserved. * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: * @@ -46,11 +46,11 @@ inline_speed void kqueue_change (EV_P_ int fd, int filter, int flags, int fflags) { ++kqueue_changecnt; - array_needsize (struct kevent, kqueue_changes, kqueue_changemax, kqueue_changecnt, EMPTY2); + array_needsize (struct kevent, kqueue_changes, kqueue_changemax, kqueue_changecnt, array_needsize_noinit); EV_SET (&kqueue_changes [kqueue_changecnt - 1], fd, filter, flags, fflags, 0, 0); } /* OS X at least needs this */ @@ -104,11 +104,11 @@ kqueue_changecnt = 0; if (expect_false (res < 0)) { if (errno != EINTR) - ev_syserr ("(libev) kevent"); + ev_syserr ("(libev) kqueue kevent"); return; } for (i = 0; i < res; ++i) @@ -127,13 +127,19 @@ else if (err == EBADF) /* on EBADF, we re-check the fd */ { if (fd_valid (fd)) kqueue_modify (EV_A_ fd, 0, anfds [fd].events); else - fd_kill (EV_A_ fd); + { + assert (("libev: kqueue found invalid fd", 0)); + fd_kill (EV_A_ fd); + } } else /* on all other errors, we error out on the fd */ - fd_kill (EV_A_ fd); + { + assert (("libev: kqueue found invalid fd", 0)); + fd_kill (EV_A_ fd); + } } } else fd_event ( EV_A_