Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Re: Help on use of DMX_OUT_TAP (II)



Tim Wiffen wrote:

I am not convinced that the poll method is better.  When I switched from
GCC 2.95 to GCC 3.2 I found that dvbtune stopped being able to read PSI
tables.  This code:

struct pollfd ufd;

** SNIP **

fd_pat = open(demuxdev[card],O_RDWR|O_NONBLOCK)

** SNIP **

ufd.fd=fd_pat;
ufd.events=POLLPRI;
if (poll(&ufd,1,2000) < 0) {
  fprintf(stderr,"TIMEOUT reading from fd_pat\n");
  close(fd_pat);
  return;
}
if (read(fd_pat,buf,3)==3) {
	
** SNIP **

You don't distinguish between read() returning success (> 0)
or error (-1). You also don't check ufd.revents. Please read the
manual pages for poll() and read() thoroughly.

} else {
 fprintf(stderr,"Nothing to read from fd_pat\n");

For the DVB driver read() can never return 0 (meaning end-of-file).
There must be something wrong with your system libraries or compiler.

}

Always returns "Nothing to read from fd_pat" when compiled on my system
with GCC 3.2 but the binary compiled with GCC 2.95 works perfectly on
the same system.  The error returned was always "Resource temporarily
unavailable".

Odd.


Johannes




--
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index