summaryrefslogtreecommitdiff
path: root/tpool/aio_simulated.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-12-03 08:44:49 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2019-12-03 11:05:18 +0200
commit57444a3b3086e96272cf10c3749c5ddb5f990492 (patch)
tree65e5616d80af04e1cc37d8d8d6db43142c3756e7 /tpool/aio_simulated.cc
parentcd92c6c83dd92cee2ccccd107988da032b2026f8 (diff)
downloadmariadb-git-57444a3b3086e96272cf10c3749c5ddb5f990492.tar.gz
MDEV-16264: Minor cleanup
aio_linux::m_max_io_count: Unused data member; remove. aiocb::m_ret_len: Declare as the more compatible type size_t. Unfortunately, ssize_t is not available on Microsoft Visual Studio.
Diffstat (limited to 'tpool/aio_simulated.cc')
-rw-r--r--tpool/aio_simulated.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/tpool/aio_simulated.cc b/tpool/aio_simulated.cc
index 7deaf745aa2..4811797a75e 100644
--- a/tpool/aio_simulated.cc
+++ b/tpool/aio_simulated.cc
@@ -133,7 +133,11 @@ public:
static void simulated_aio_callback(void *param)
{
aiocb *cb= (aiocb *) param;
- int ret_len;
+#ifdef _WIN32
+ size_t ret_len;
+#else
+ ssize_t ret_len;
+#endif
int err= 0;
switch (cb->m_opcode)
{
@@ -146,14 +150,13 @@ public:
default:
abort();
}
- if (ret_len < 0)
- {
#ifdef _WIN32
+ if (static_cast<int>(ret_len) < 0)
err= GetLastError();
#else
+ if (ret_len < 0)
err= errno;
#endif
- }
cb->m_ret_len = ret_len;
cb->m_err = err;
cb->m_callback(cb);