summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2013-12-19 00:27:43 -0800
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2013-12-19 00:27:43 -0800
commit0bca59a4e01d264fbfacc74809fc5d606915163f (patch)
tree07f87f3b4f0427602265540f356a5489aa743bbd
parentaec952125146ef754b755f75bf9281d16e837155 (diff)
Implementing win32's Input reads.
-rw-r--r--src/Input.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Input.cc b/src/Input.cc
index c1b7b98..2a87a5d 100644
--- a/src/Input.cc
+++ b/src/Input.cc
@@ -220,8 +220,12 @@ class AsyncOpRead : public Balau::AsyncOperation {
AsyncOpRead(int fd, void * buf, size_t count, off_t offset, cbResults_t * results) : m_fd(fd), m_buf(buf), m_count(count), m_offset(offset), m_results(results) { }
virtual void run() {
#ifdef _MSC_VER
- IAssert(0, "Not yet implemented");
- const ssize_t r = 0;
+ off_t offset = lseek(m_fd, m_offset, SEEK_SET);
+ if (offset < 0) {
+ m_results->errorno = errno;
+ return;
+ }
+ const ssize_t r = m_results->result = read(m_fd, m_buf, m_count);
#else
const ssize_t r = m_results->result = pread(m_fd, m_buf, m_count, m_offset);
#endif