Re: FreeTDS 0.82 on Microsoft SUA/Interix

Chandana De Silva <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <9055909.361250797605148.JavaMail.chandana@fatta>
Thank you to those who replied.

After some more digging, the problem was found.

The problem is in src/tds/net.c - in the tds_select function.

For some reason the configure script was setting USE_POLL on, and it was using the poll function rather than select. Changed USE_POLL to off and it now works fin

Hope somebody who knows more than me can sort out the problem with configure..

Thanks

Chandana


<snip>
timeval pointer to select(2). 
	 */
	poll_seconds = (tds->tds_ctx && tds->tds_ctx->int_handler)? 1 : timeout_seconds;
	for (seconds = timeout_seconds; timeout_seconds == 0 || seconds > 0; seconds -= poll_seconds) {
#if USE_POLL
		struct pollfd fd;
		int timeout = poll_seconds ? poll_seconds * 1000 : -1;

		fd.fd = tds->s;
		fd.events = tds_sel;
		fd.revents = 0;
		rc = poll(&fd, 1, timeout);
#else
		struct timeval tv, *ptv = poll_seconds? &tv : NULL;
		tv.tv_sec = poll_seconds;
		tv.tv_usec = 0; 

		if (readfds)
			FD_SET(tds->s, readfds);
		if (writefds)
			FD_SET(tds->s, writefds);
		if (exceptfds)
			FD_SET(tds->s, exceptfds);

		rc = select(tds->s + 1, readfds, writefds, exceptfds, ptv); 
#endif
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.