--- tune.c.old Fri Feb 6 23:30:36 2004 +++ tune.c Thu May 20 14:43:05 2004 @@ -28,6 +28,7 @@ #include #include #include +#include #ifdef NEWSTRUCT #include @@ -219,6 +220,7 @@ struct dvb_frontend_info fe_info; struct pollfd pfd[1]; int status; + time_t start; if (ioctl(fd_frontend,FE_SET_FRONTEND,feparams) < 0) { perror("ERROR tuning channel\n"); @@ -228,8 +230,9 @@ pfd[0].fd = fd_frontend; pfd[0].events = POLLIN; + start = time(NULL); event.status=0; - while (((event.status & FE_TIMEDOUT)==0) && ((event.status & FE_HAS_LOCK)==0)) { + while (((event.status & FE_TIMEDOUT)==0) && ((event.status & FE_HAS_LOCK)==0) && ((time(NULL)-start) < 60)) { fprintf(stderr,"polling....\n"); if (poll(pfd,1,10000)){ if (pfd[0].revents & POLLIN){