summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVincent Hamm <vincent.hamm@gmail.com>2014-06-02 22:35:05 -0700
committerVincent Hamm <vincent.hamm@gmail.com>2014-06-02 22:35:05 -0700
commit185dc2e4a06c52937a3f260b2469cda7d62f6112 (patch)
tree8c00003343a4b1d16b7a9401249dea3e6b98cae3 /src
parent59887a3f4bc40667964e224d77f83e4551d03baf (diff)
Fix 64bit seek
Set result to -1 when seek fails
Diffstat (limited to 'src')
-rw-r--r--src/Input.cc3
-rw-r--r--src/Output.cc3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/Input.cc b/src/Input.cc
index 87d9be3..d266650 100644
--- a/src/Input.cc
+++ b/src/Input.cc
@@ -220,8 +220,9 @@ class AsyncOpRead : public Balau::AsyncOperation {
AsyncOpRead(int fd, void * buf, size_t count, off64_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
- off64_t offset = lseek(m_fd, m_offset, SEEK_SET);
+ off64_t offset = _lseeki64(m_fd, m_offset, SEEK_SET);
if (offset < 0) {
+ m_results->result = -1;
m_results->errorno = errno;
return;
}
diff --git a/src/Output.cc b/src/Output.cc
index 8e962be..b653333 100644
--- a/src/Output.cc
+++ b/src/Output.cc
@@ -220,8 +220,9 @@ class AsyncOpWrite : public Balau::AsyncOperation {
AsyncOpWrite(int fd, const void * buf, size_t count, off64_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
- off64_t offset = lseek(m_fd, m_offset, SEEK_SET);
+ off64_t offset = _lseeki64(m_fd, m_offset, SEEK_SET);
if (offset < 0) {
+ m_results->result = -1;
m_results->errorno = errno;
return;
}