1
0
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:
Patrick LeBlanc
2019-02-04 14:44:35 -06:00
parent 4769e896f8
commit 8ef4e09aa4
23 changed files with 105 additions and 108 deletions

View File

@@ -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;
}
}