add file and line number to kevent_cmp()

git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@425 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
This commit is contained in:
mheily 2011-02-15 23:53:04 +00:00
parent 429d3717b3
commit a2b8894d94
2 changed files with 5 additions and 4 deletions

View File

@ -76,7 +76,8 @@ struct kevent * kevent_get(int);
void kevent_update(int kqfd, struct kevent *kev);
void kevent_cmp(struct kevent *, struct kevent *);
#define kevent_cmp(a,b) _kevent_cmp(a,b, __FILE__, __LINE__)
void _kevent_cmp(struct kevent *, struct kevent *, const char *, int);
void
kevent_add(int kqfd, struct kevent *kev,

View File

@ -164,7 +164,7 @@ kevent_add(int kqfd, struct kevent *kev,
}
void
kevent_cmp(struct kevent *k1, struct kevent *k2)
_kevent_cmp(struct kevent *k1, struct kevent *k2, const char *file, int line)
{
/* XXX-
Workaround for inconsistent implementation of kevent(2)
@ -174,8 +174,8 @@ kevent_cmp(struct kevent *k1, struct kevent *k2)
k2->flags |= EV_ADD;
#endif
if (memcmp(k1, k2, sizeof(*k1)) != 0) {
printf("kevent_cmp: mismatch:\n expected %s\n but got %s\n",
kevent_to_str(k1), kevent_to_str(k2));
printf("[%s:%d]: kevent_cmp() failed:\n expected %s\n but got %s\n",
file, line, kevent_to_str(k1), kevent_to_str(k2));
abort();
}
}