summaryrefslogtreecommitdiff
path: root/src/swap.cpp
diff options
context:
space:
mode:
authorMartin Lucina <mato@kotelna.sk>2011-09-08 16:38:46 +0200
committerMartin Lucina <martin@lucina.net>2012-01-23 08:54:16 +0100
commit88f712b4a31c95caef4f34c4ec65793c392314a6 (patch)
tree2f17936ce9d53b1b13908e8d4288846aaa604263 /src/swap.cpp
parentad3e013f74d309b86e8f087932203e5787fe2d2d (diff)
parent75af6aed482ab16997c1388fe801f74d11ec12a4 (diff)
Imported Debian patch 2.1.9-1debian/2.1.9-1
Diffstat (limited to 'src/swap.cpp')
-rw-r--r--src/swap.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/swap.cpp b/src/swap.cpp
index 936f30e..5f1b261 100644
--- a/src/swap.cpp
+++ b/src/swap.cpp
@@ -111,7 +111,7 @@ int zmq::swap_t::init ()
if (fd == -1)
return -1;
-#ifdef ZMQ_HAVE_LINUX
+#if (defined (ZMQ_HAVE_LINUX) && !defined (ZMQ_HAVE_ANDROID))
// Enable more aggresive read-ahead optimization.
posix_fadvise (fd, 0, filesize, POSIX_FADV_SEQUENTIAL);
#endif
@@ -135,8 +135,6 @@ bool zmq::swap_t::store (zmq_msg_t *msg_)
copy_to_file (&msg_flags, sizeof msg_flags);
copy_to_file (zmq_msg_data (msg_), msg_size);
- zmq_msg_close (msg_);
-
return true;
}
@@ -214,7 +212,7 @@ void zmq::swap_t::copy_from_file (void *buffer_, size_t count_)
size_t chunk_size, remainder = count_;
while (remainder > 0) {
- chunk_size = std::min (remainder,
+ chunk_size = std::min (remainder,
std::min ((size_t) (filesize - read_pos),
(size_t) (block_size - read_pos % block_size)));
@@ -238,7 +236,7 @@ void zmq::swap_t::copy_to_file (const void *buffer_, size_t count_)
size_t chunk_size, remainder = count_;
while (remainder > 0) {
- chunk_size = std::min (remainder,
+ chunk_size = std::min (remainder,
std::min ((size_t) (filesize - write_pos),
(size_t) (block_size - write_pos % block_size)));