- int flags = fcntl(priv->eventc->fd, F_GETFL);
- int ret = fcntl(priv->eventc->fd, F_SETFL, flags | O_NONBLOCK);
+ int flags;
+ int ret;
+
+ if (!priv->eventc)
+ /* All virtqs are in poll mode. */
+ return 0;
+ flags = fcntl(priv->eventc->fd, F_GETFL);
+ ret = fcntl(priv->eventc->fd, F_SETFL, flags | O_NONBLOCK);