/* Upon successful completion, poll() shall return a non-negative value. A positive value indicates the total number of pollfd structures that have selected events (that is, those for which the revents member is non-zero). A value of 0 indicates that the call timed out and no file descriptors have been selected. Upon failure, poll() shall return -1 and set errno to indicate the error.  */
static int wait(int timeout)
/* Upon successful completion, poll() shall return a non-negative value. A positive value indicates the total number of pollfd structures that have selected events (that is, those for which the revents member is non-zero). A value of 0 indicates that the call timed out and no file descriptors have been selected. Upon failure, poll() shall return -1 and set errno to indicate the error.  */
static int wait(int timeout)
{
	int rc = 0;
	if (sh_mqtt->nfds > 0) {
		rc = zsock_poll(sh_mqtt->fds, sh_mqtt->nfds, timeout);
		if (rc < 0) {
			LOG_ERR("poll error: %d", errno);
		}
	}
	return rc;
}