1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-06-12 05:01:56 +03:00

Fixed the error path in SMDataFile read() and write()

This commit is contained in:
Patrick LeBlanc
2019-04-23 16:01:19 -05:00
parent 46163c129a
commit 08923813cb

View File

@ -48,6 +48,8 @@ ssize_t SMDataFile::pread(void *buf, off64_t offset, size_t count)
ssize_t SMDataFile::read(void *buf, size_t count)
{
ssize_t ret = comm->pread(name(), buf, count, position);
if (ret < 0)
return ret;
position += ret;
return ret;
}
@ -57,6 +59,8 @@ ssize_t SMDataFile::write(const void *buf, size_t count)
if (openmode & O_APPEND)
return comm->append(name(), buf, count);
ssize_t ret = comm->pwrite(name(), buf, count, position);
if (ret < 0)
return ret;
position += ret;
return ret;
}