add: pfd.revents = 0;
context: Ns_SockWait(int sock, int what, int timeout){    struct pollfd pfd;    int n;    if (timeout < 0) {    	return NS_TIMEOUT;    }    timeout *= 1000;    pfd.fd = sock;    switch (what) {    case NS_SOCK_READ:	pfd.events = POLLIN;	break;    case NS_SOCK_WRITE:	pfd.events = POLLOUT;	break;    case NS_SOCK_EXCEPTION:	pfd.events = POLLPRI;	break;    default:	return NS_ERROR;	break;    }    do {	n = poll(&pfd, 1, timeout);    } while (n < 0 && errno == EINTR);    if (n > 0) {	return NS_OK;    }    return NS_TIMEOUT;}