You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-12-18 13:54:11 +03:00
Changed ownership of the socket.
This commit is contained in:
@@ -16,39 +16,40 @@ TruncateTask::~TruncateTask()
|
||||
{
|
||||
}
|
||||
|
||||
#define check_error(msg) \
|
||||
#define check_error(msg, ret) \
|
||||
if (!success) \
|
||||
{ \
|
||||
handleError(msg, errno); \
|
||||
return; \
|
||||
return ret; \
|
||||
}
|
||||
|
||||
void TruncateTask::run()
|
||||
bool TruncateTask::run()
|
||||
{
|
||||
bool success;
|
||||
uint8_t buf[1024] = {0};
|
||||
|
||||
if (getLength() > 1023) {
|
||||
handleError("TruncateTask read", ENAMETOOLONG);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
success = read(buf, getLength());
|
||||
check_error("TruncateTask read");
|
||||
check_error("TruncateTask read", false);
|
||||
truncate_cmd *cmd = (truncate_cmd *) buf;
|
||||
|
||||
int err = ioc->truncate(cmd->filename, cmd->length);
|
||||
if (err)
|
||||
{
|
||||
handleError("TruncateTask truncate", errno);
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
sm_msg_resp *resp = (sm_msg_resp *) buf;
|
||||
resp->type = SM_MSG_START;
|
||||
resp->payloadLen = 4;
|
||||
resp->returnCode = 0;
|
||||
write(buf, sizeof(sm_msg_resp));
|
||||
success = write(buf, sizeof(sm_msg_resp));
|
||||
return success;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user