summaryrefslogtreecommitdiff
path: root/tools/select.c
diff options
context:
space:
mode:
authorlordjaxom <lordjaxom>2005-02-08 13:59:16 +0000
committerlordjaxom <lordjaxom>2005-02-08 13:59:16 +0000
commit8e4556b0a982dab75d8ba3bb388965ecf47fa0b0 (patch)
treecda6583f76af5967c634fffe454b003052baf521 /tools/select.c
parent04a5985dcc0a24a1ff7b8debd5e88d4de46bb989 (diff)
downloadvdr-plugin-streamdev-8e4556b0a982dab75d8ba3bb388965ecf47fa0b0.tar.gz
vdr-plugin-streamdev-8e4556b0a982dab75d8ba3bb388965ecf47fa0b0.tar.bz2
- first adoptions (transfer-commit)
Diffstat (limited to 'tools/select.c')
-rw-r--r--tools/select.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/tools/select.c b/tools/select.c
index 77229c8..0ab5f9b 100644
--- a/tools/select.c
+++ b/tools/select.c
@@ -16,7 +16,6 @@ cTBSelect::~cTBSelect() {
int cTBSelect::Select(uint TimeoutMs) {
struct timeval tv;
- time_t st, et;
ssize_t res;
int ms;
@@ -26,15 +25,13 @@ int cTBSelect::Select(uint TimeoutMs) {
if (TimeoutMs == 0)
return ::select(m_MaxFiled + 1, &m_Rfds, &m_Wfds, NULL, &tv);
- st = time_ms();
+ cTimeMs starttime;
ms = TimeoutMs;
while (ms > 0 && (res = ::select(m_MaxFiled + 1, &m_Rfds, &m_Wfds, NULL,
&tv)) == -1 && errno == EINTR) {
- et = time_ms();
- ms -= et - st;
+ ms = TimeoutMs - starttime.Elapsed();
tv.tv_usec = (ms % 1000) * 1000;
tv.tv_sec = ms / 1000;
- st = et;
}
if (ms <= 0) {
errno = ETIMEDOUT;