X-Git-Url: https://repo.jachan.dev/qemu.git/blobdiff_plain/b6825cd79cdf3e2006c22bb8cfe47a0d7c5209fa..7e480893cc3eb9f307199517f0e1d5c8e72a030f:/iohandler.c diff --git a/iohandler.c b/iohandler.c index dea43552d2..a2d871bb91 100644 --- a/iohandler.c +++ b/iohandler.c @@ -56,6 +56,8 @@ int qemu_set_fd_handler2(int fd, { IOHandlerRecord *ioh; + assert(fd >= 0); + if (!fd_read && !fd_write) { QLIST_FOREACH(ioh, &io_handlers, next) { if (ioh->fd == fd) {