Skip to content

Commit cff30c4

Browse files
committed
check only one event is returned in kevent() call to allow type coercion
1 parent 884bd36 commit cff30c4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/shims/linux_stubs.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,11 @@ int kevent64(int kq, /*const*/ struct kevent64_s *changelist, int nchanges, stru
169169
}
170170
}
171171
#endif
172-
return kevent(kq,(struct kevent*) changelist,nchanges,(struct kevent*) eventlist,nevents,timeout);
172+
// eventlist can not return more than 1 event type coersion doesn't work
173+
int rc = kevent(kq,(struct kevent*) changelist,nchanges,(struct kevent*) eventlist,nevents,timeout);
174+
if (rc > 1)
175+
LINUX_PORT_ERROR();
176+
return rc;
173177
}
174178

175179
/*

0 commit comments

Comments
 (0)