More Solaris improvements

git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@428 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
This commit is contained in:
mheily 2011-02-16 03:11:19 +00:00
parent ee14f0ff35
commit 3c17c8a2b0
3 changed files with 8 additions and 3 deletions

View File

@ -106,8 +106,10 @@ evfilt_socket_knote_modify(struct filter *filt, struct knote *kn,
int
evfilt_socket_knote_delete(struct filter *filt, struct knote *kn)
{
/* FIXME: should be handled at kevent_copyin()
if (kn->kev.flags & EV_DISABLE)
return (0);
*/
if (port_dissociate(filter_epfd(filt), PORT_SOURCE_FD, kn->kev.ident) < 0) {
dbg_perror("port_dissociate(2)");
@ -120,12 +122,14 @@ evfilt_socket_knote_delete(struct filter *filt, struct knote *kn)
int
evfilt_socket_knote_enable(struct filter *filt, struct knote *kn)
{
dbg_printf("enabling knote %p", kn);
return evfilt_socket_knote_create(filt, kn);
}
int
evfilt_socket_knote_disable(struct filter *filt, struct knote *kn)
{
dbg_printf("disabling knote %p", kn);
return evfilt_socket_knote_delete(filt, kn);
}

View File

@ -99,7 +99,8 @@ kevent_add(int kqfd, struct kevent *kev,
} while (0);
/* Checks if any events are pending, which is an error. */
void test_no_kevents(int);
#define test_no_kevents(a) _test_no_kevents(a, __FILE__, __LINE__)
void _test_no_kevents(int, const char *, int);
/* From test.c */
void test_begin(const char *);

View File

@ -20,7 +20,7 @@ extern int kqfd;
/* Checks if any events are pending, which is an error. */
void
test_no_kevents(int kqfd)
_test_no_kevents(int kqfd, const char *file, int line)
{
int nfds;
struct timespec timeo;
@ -31,7 +31,7 @@ test_no_kevents(int kqfd)
if (nfds < 0)
die("kevent(2)");
if (nfds > 0) {
puts("\nUnexpected event:");
printf("\n[%s:%d]: Unexpected event:", file, line);
die(kevent_to_str(&kev));
}
}