1 diff -u tuxtxt_orig/tuxtxt.c tuxtxt/tuxtxt.c
2 --- tuxtxt_orig/tuxtxt.c 2008-12-26 19:41:28.000000000 +0100
3 +++ tuxtxt/tuxtxt.c 2009-01-29 21:36:31.000000000 +0100
8 - fcntl(rc, F_SETFL, O_NONBLOCK);
9 ioctl(rc, RC_IOCTL_BCODES, 1);
14 void ConfigMenu(int Init)
16 - int val, menuitem = M_Start;
17 + int menuitem = M_Start;
21 @@ -1257,10 +1256,6 @@
22 renderinfo.clearbbcolor = tuxtxt_color_black;
23 Menu_Init(menu, current_pid, menuitem, hotindex);
25 - /* set blocking mode */
26 - val = fcntl(rc, F_GETFL);
27 - fcntl(rc, F_SETFL, val &~ O_NONBLOCK);
33 current_service = current_pid;
34 // RenderMessage(ShowServiceName);
36 - fcntl(rc, F_SETFL, O_NONBLOCK);
39 tuxtxt_SwitchScreenMode(&renderinfo,oldscreenmode); /* restore divided screen */
41 UpdateLCD(); /* update number of cached pages */
42 } while ((RCCode != RC_HOME) && (RCCode != RC_DBOX) && (RCCode != RC_MUTE));
44 - /* reset to nonblocking mode */
45 - fcntl(rc, F_SETFL, O_NONBLOCK);
46 tuxtxt_cache.pageupdate = 1;
52 int active_national_subset=tuxtxt_cache.national_subset;
55 int oldzoommode = renderinfo.zoommode;
57 renderinfo.pagecatching = 1;
58 @@ -2046,10 +2038,6 @@
62 - /* set blocking mode */
63 - val = fcntl(rc, F_GETFL);
64 - fcntl(rc, F_SETFL, val &~ O_NONBLOCK);
73 - fcntl(rc, F_SETFL, O_NONBLOCK);
74 tuxtxt_cache.pageupdate = 1;
75 renderinfo.pagecatching = 0;
78 tuxtxt_cache.subpage = subp;
80 tuxtxt_cache.subpage = 0;
82 - /* reset to nonblocking mode */
83 - fcntl(rc, F_SETFL, O_NONBLOCK);
86 /******************************************************************************
87 @@ -2712,16 +2696,34 @@
93 + struct timeval timeout;
94 #if HAVE_DVB_API_VERSION < 3
95 static unsigned short LastKey = -1;
97 struct input_event ev;
98 static __u16 rc_last_key = KEY_RESERVED;
101 + timeout.tv_sec = 0;
102 + timeout.tv_usec = 100000;
104 -#if HAVE_DVB_API_VERSION < 3
105 - if (read(rc, &RCCode, 2) == 2)
114 + if (select(maxfd + 1, &rset, NULL, NULL, &timeout) > 0)
116 + if (rc >= 0 && FD_ISSET(rc, &rset))
118 +#if HAVE_DVB_API_VERSION < 3
119 + read(rc, &RCCode, 2);
121 if (RCCode != LastKey)
124 @@ -2730,8 +2732,8 @@
128 - if (read(rc, &ev, sizeof(ev)) == sizeof(ev))
130 + read(rc, &ev, sizeof(ev));
134 if (ev.code != rc_last_key)
135 @@ -2789,7 +2791,6 @@
139 - usleep(1000000/100);