Commit dcd19cba authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

LIRC: keep same pollfd

There is no need to reinitialize the structure.
parent 495b0633
...@@ -159,16 +159,18 @@ static void *Run( void *data ) ...@@ -159,16 +159,18 @@ static void *Run( void *data )
intf_thread_t *p_intf = data; intf_thread_t *p_intf = data;
intf_sys_t *p_sys = p_intf->p_sys; intf_sys_t *p_sys = p_intf->p_sys;
struct pollfd ufd;
ufd.fd = p_sys->i_fd;
ufd.events = POLLIN;
for( ;; ) for( ;; )
{ {
/* Wait for data */ /* Wait for data */
struct pollfd ufd = { .fd = p_sys->i_fd, .events = POLLIN, .revents = 0 };
if( poll( &ufd, 1, -1 ) == -1 ) if( poll( &ufd, 1, -1 ) == -1 )
{ {
if( errno == EINTR ) if( errno == EINTR )
continue; continue;
else break;
break;
} }
/* Process */ /* Process */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment