1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-12-18 13:54:11 +03:00

Phase 1 of trying to clean up some messaging code.

This commit is contained in:
Patrick LeBlanc
2019-02-11 18:08:18 -06:00
parent d792f78c25
commit b78cac755b
16 changed files with 123 additions and 104 deletions

View File

@@ -47,19 +47,16 @@ bool OpenTask::run()
#ifdef SM_TRACE
cout << "open filename " << cmd->filename << " mode " << oct << cmd->openmode << dec << endl;
#endif
int err = ioc->open(cmd->filename, cmd->openmode, (struct stat *) &buf[sizeof(sm_msg_resp)]);
sm_response *resp = (sm_response *) buf;
int err = ioc->open(cmd->filename, cmd->openmode, (struct stat *) &resp->payload);
if (err)
{
handleError("OpenTask open", errno);
return true;
}
sm_msg_resp *resp = (sm_msg_resp *) buf;
resp->type = SM_MSG_START;
resp->payloadLen = sizeof(struct stat) + 4;
resp->returnCode = 0;
success = write(buf, sizeof(struct stat) + sizeof(sm_msg_resp));
success = write(*resp, sizeof(struct stat));
if (!success)
handleError("OpenTask write", errno);
return success;