summaryrefslogtreecommitdiff
path: root/netfs/daemon/daemonFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'netfs/daemon/daemonFile.cpp')
-rw-r--r--netfs/daemon/daemonFile.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/netfs/daemon/daemonFile.cpp b/netfs/daemon/daemonFile.cpp
index 7b2dd8e..d9f5105 100644
--- a/netfs/daemon/daemonFile.cpp
+++ b/netfs/daemon/daemonFile.cpp
@@ -59,10 +59,11 @@ FileServer::read(Ice::Long offset, Ice::Long size, const Ice::Current &)
}
void
-FileServer::write(Ice::Long offset, Ice::Long size, const NetFS::Buffer data, const Ice::Current &)
+FileServer::write(Ice::Long offset, Ice::Long size, const ::std::pair<const ::Ice::Byte *, const ::Ice::Byte *> data,
+ const Ice::Current &)
{
errno = 0;
- if (pwrite(fd, &data.front(), safe {size}, offset) != size) {
+ if (pwrite(fd, data.first, safe {size}, offset) != size) {
throw NetFS::SystemError(errno);
}
}
@@ -80,7 +81,8 @@ FileServer::copyrange(NetFS::FilePrxPtr to, Ice::Long offsrc, Ice::Long offdst,
throw NetFS::SystemError(errno);
}
else {
- to->write(offdst, size, read(offsrc, size, ice));
+ const auto bytes = read(offsrc, size, ice);
+ to->write(offdst, size, {bytes.data(), bytes.data() + size});
return size;
}
}