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) |
306 | 306 | { |
307 | 307 | // timeout gets reset by select, so we need to create new one |
308 | 308 | 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 | } |
310 | 316 | len = read(dvr_fd, &(buffer[remainder]), buffer_size - remainder); |
311 | 317 | } |
312 | 318 | |