You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-07 03:22:57 +03:00
MCOL-3563: fix compiler warnings / type errors.
A previous commit made posix::read changed return value from bool to int. However some callers still expected bool and compared a bool<0 which is always false.
This commit is contained in:
@@ -43,7 +43,7 @@ CopyTask::~CopyTask()
|
||||
|
||||
bool CopyTask::run()
|
||||
{
|
||||
bool success;
|
||||
int success;
|
||||
SMLogging* logger = SMLogging::get();
|
||||
|
||||
uint8_t buf[2048] = {0};
|
||||
@@ -83,8 +83,7 @@ bool CopyTask::run()
|
||||
|
||||
sm_response *resp = (sm_response *) buf;
|
||||
resp->returnCode = 0;
|
||||
success = write(*resp, 0);
|
||||
return success;
|
||||
return write(*resp, 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -37,7 +37,7 @@ ListDirectoryTask::~ListDirectoryTask()
|
||||
}
|
||||
|
||||
#define check_error(msg, ret) \
|
||||
if (success<0) \
|
||||
if (!success) \
|
||||
{ \
|
||||
handleError(msg, errno); \
|
||||
return ret; \
|
||||
@@ -85,8 +85,12 @@ bool ListDirectoryTask::run()
|
||||
return true;
|
||||
}
|
||||
|
||||
success = read(buf, getLength());
|
||||
check_error("ListDirectoryTask read", false);
|
||||
err = read(buf, getLength());
|
||||
if (err<0)
|
||||
{
|
||||
handleError("ListDirectoryTask read", errno);
|
||||
return false;
|
||||
}
|
||||
listdir_cmd *cmd = (listdir_cmd *) buf;
|
||||
|
||||
#ifdef SM_TRACE
|
||||
|
@@ -54,7 +54,7 @@ bool ReadTask::run()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool success;
|
||||
int success;
|
||||
success = read(buf, getLength());
|
||||
check_error("ReadTask read cmd", false);
|
||||
read_cmd *cmd = (read_cmd *) buf;
|
||||
@@ -103,8 +103,7 @@ bool ReadTask::run()
|
||||
}
|
||||
if (resp->returnCode >= 0)
|
||||
payloadLen = resp->returnCode;
|
||||
success = write(*resp, payloadLen);
|
||||
return success;
|
||||
return write(*resp, payloadLen);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -48,7 +48,7 @@ StatTask::~StatTask()
|
||||
bool StatTask::run()
|
||||
{
|
||||
SMLogging* logger = SMLogging::get();
|
||||
bool success;
|
||||
int success;
|
||||
uint8_t buf[1024] = {0};
|
||||
|
||||
if (getLength() > 1023) {
|
||||
@@ -84,8 +84,7 @@ bool StatTask::run()
|
||||
payloadLen = 4;
|
||||
*((int32_t *) resp->payload) = errno;
|
||||
}
|
||||
success = write(*resp, payloadLen);
|
||||
return success;
|
||||
return write(*resp, payloadLen);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -44,7 +44,7 @@ TruncateTask::~TruncateTask()
|
||||
bool TruncateTask::run()
|
||||
{
|
||||
SMLogging* logger = SMLogging::get();
|
||||
bool success;
|
||||
int success;
|
||||
uint8_t buf[1024] = {0};
|
||||
|
||||
if (getLength() > 1023) {
|
||||
@@ -79,8 +79,7 @@ bool TruncateTask::run()
|
||||
|
||||
sm_response *resp = (sm_response *) buf;
|
||||
resp->returnCode = 0;
|
||||
success = write(*resp, 0);
|
||||
return success;
|
||||
return write(*resp, 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -45,7 +45,7 @@ UnlinkTask::~UnlinkTask()
|
||||
bool UnlinkTask::run()
|
||||
{
|
||||
SMLogging* logger = SMLogging::get();
|
||||
bool success;
|
||||
int success;
|
||||
uint8_t buf[1024] = {0};
|
||||
|
||||
if (getLength() > 1023) {
|
||||
@@ -81,8 +81,7 @@ bool UnlinkTask::run()
|
||||
|
||||
sm_response *resp = (sm_response *) buf;
|
||||
resp->returnCode = 0;
|
||||
success = write(*resp, 0);
|
||||
return success;
|
||||
return write(*resp, 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user