Ticket #5127: libs_libmythtv_dvbchannel.cpp-check-select.patch

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

check select() for failure

  • libs/libmythtv/dvbchannel.cpp

    Always check calls to select()
    
    From: Erik Hovland <erik@hovland.org>
    
    
    ---
    
     libs/libmythtv/dvbchannel.cpp |    8 +++++++-
     1 files changed, 7 insertions(+), 1 deletions(-)
    
    diff --git a/libs/libmythtv/dvbchannel.cpp b/libs/libmythtv/dvbchannel.cpp
    index ebcccc7..aaccde7 100644
    a b static bool wait_for_backend(int fd, int timeout_ms) 
    10621062
    10631063    // Try to wait for some output like an event, unfortunately
    10641064    // this fails on several DVB cards, so we have a timeout.
    1065     select(fd+1, &fd_select_set, NULL, NULL, &select_timeout);
     1065    if (select(fd+1, &fd_select_set, NULL, NULL, &select_timeout) == -1 && errno != EINTR)
     1066    {
     1067        VERBOSE(VB_IMPORTANT, QString("dvbchannel.cpp:wait_for_backend: "
     1068                                      "Failed to wait on output, error: %1")
     1069                .arg(strerror(errno)));
     1070        return false;
     1071    }
    10661072
    10671073    // This is supposed to work on all cards, post 2.6.12...
    10681074    fe_status_t status;