You've already forked mariadb-columnstore-engine
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:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user