Ticket #5142: libs_libmythtv_dvbstreamhandler.cpp-always-check-select.patch

File libs_libmythtv_dvbstreamhandler.cpp-always-check-select.patch, 1.1 KB (added by Erik Hovland <erik@…>, 12 years ago)

init _open_pid_filters in ctor

  • libs/libmythtv/dvbstreamhandler.cpp

    Always check the return value of select()
    
    From: Erik Hovland <erik@hovland.org>
    
    
    ---
    
     libs/libmythtv/dvbstreamhandler.cpp |    8 +++++++-
     1 files changed, 7 insertions(+), 1 deletions(-)
    
    diff --git a/libs/libmythtv/dvbstreamhandler.cpp b/libs/libmythtv/dvbstreamhandler.cpp
    index 5a2716a..5451457 100644
    a b void DVBStreamHandler::RunTS(void) 
    306306        {
    307307            // timeout gets reset by select, so we need to create new one
    308308            struct timeval timeout = { 0, 50 /* ms */ * 1000 /* -> usec */ };
    309             select(dvr_fd+1, &fd_select_set, NULL, NULL, &timeout);
     309            if (select(dvr_fd+1, &fd_select_set, NULL, NULL, &timeout) == -1 && errno != EINTR)
     310            {
     311                VERBOSE(VB_IMPORTANT,
     312                        LOC_ERR + QString("select() failed with %1")
     313                        .arg(strerror(errno)));
     314                _error = true;
     315            }
    310316            len = read(dvr_fd, &(buffer[remainder]), buffer_size - remainder);
    311317        }
    312318