diff options
author | lordjaxom <lordjaxom> | 2005-02-08 13:59:16 +0000 |
---|---|---|
committer | lordjaxom <lordjaxom> | 2005-02-08 13:59:16 +0000 |
commit | 8e4556b0a982dab75d8ba3bb388965ecf47fa0b0 (patch) | |
tree | cda6583f76af5967c634fffe454b003052baf521 /tools/source.c | |
parent | 04a5985dcc0a24a1ff7b8debd5e88d4de46bb989 (diff) | |
download | vdr-plugin-streamdev-8e4556b0a982dab75d8ba3bb388965ecf47fa0b0.tar.gz vdr-plugin-streamdev-8e4556b0a982dab75d8ba3bb388965ecf47fa0b0.tar.bz2 |
- first adoptions (transfer-commit)
Diffstat (limited to 'tools/source.c')
-rw-r--r-- | tools/source.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/tools/source.c b/tools/source.c index 91c36c8..e882583 100644 --- a/tools/source.c +++ b/tools/source.c @@ -56,10 +56,9 @@ ssize_t cTBSource::Write(const void *Buffer, size_t Length) { bool cTBSource::TimedWrite(const void *Buffer, size_t Length, uint TimeoutMs) { cTBSelect sel; - time_t st; int ms, offs; - st = time_ms(); + cTimeMs starttime; ms = TimeoutMs; offs = 0; while (Length > 0) { @@ -77,7 +76,7 @@ bool cTBSource::TimedWrite(const void *Buffer, size_t Length, uint TimeoutMs) { Length -= b; } - ms -= time_ms() - st; + ms = TimeoutMs - starttime.Elapsed(); if (ms <= 0) { errno = ETIMEDOUT; return false; @@ -89,7 +88,6 @@ bool cTBSource::TimedWrite(const void *Buffer, size_t Length, uint TimeoutMs) { ssize_t cTBSource::ReadUntil(void *Buffer, size_t Length, const char *Seq, uint TimeoutMs) { char *offs; - time_t st; int seqlen, ms; size_t olen; cTBSelect sel; @@ -108,7 +106,7 @@ ssize_t cTBSource::ReadUntil(void *Buffer, size_t Length, const char *Seq, return olen; } - st = time_ms(); + cTimeMs starttime; ms = TimeoutMs; while (m_LineBuffer.Length() < BUFSIZ) { int b; @@ -142,7 +140,7 @@ ssize_t cTBSource::ReadUntil(void *Buffer, size_t Length, const char *Seq, } } - ms -= time_ms() - st; + ms = TimeoutMs - starttime.Elapsed(); if (ms <= 0) { errno = ETIMEDOUT; return -1; |