You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-14 11:01:50 +03:00
clang format apply
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
|
||||
#include "UnlinkTask.h"
|
||||
#include <errno.h>
|
||||
#include "messageFormat.h"
|
||||
@@ -25,7 +24,6 @@ using namespace std;
|
||||
|
||||
namespace storagemanager
|
||||
{
|
||||
|
||||
UnlinkTask::UnlinkTask(int sock, uint len) : PosixTask(sock, len)
|
||||
{
|
||||
}
|
||||
@@ -35,53 +33,53 @@ UnlinkTask::~UnlinkTask()
|
||||
}
|
||||
|
||||
#define check_error(msg, ret) \
|
||||
if (success<0) \
|
||||
{ \
|
||||
handleError(msg, errno); \
|
||||
return ret; \
|
||||
}
|
||||
|
||||
if (success < 0) \
|
||||
{ \
|
||||
handleError(msg, errno); \
|
||||
return ret; \
|
||||
}
|
||||
|
||||
bool UnlinkTask::run()
|
||||
{
|
||||
SMLogging* logger = SMLogging::get();
|
||||
int success;
|
||||
uint8_t buf[1024] = {0};
|
||||
|
||||
if (getLength() > 1023) {
|
||||
handleError("UnlinkTask read", ENAMETOOLONG);
|
||||
return true;
|
||||
}
|
||||
|
||||
success = read(buf, getLength());
|
||||
check_error("UnlinkTask read", false);
|
||||
unlink_cmd *cmd = (unlink_cmd *) buf;
|
||||
|
||||
#ifdef SM_TRACE
|
||||
logger->log(LOG_DEBUG,"unlink %s.",cmd->filename);
|
||||
#endif
|
||||
int err;
|
||||
|
||||
try
|
||||
{
|
||||
err = ioc->unlink(cmd->filename);
|
||||
}
|
||||
catch (exception &e)
|
||||
{
|
||||
logger->log(LOG_ERR, "UnlinkTask: caught '%s'", e.what());
|
||||
errno = EIO;
|
||||
err = -1;
|
||||
}
|
||||
|
||||
if (err)
|
||||
{
|
||||
handleError("UnlinkTask unlink", errno);
|
||||
return true;
|
||||
}
|
||||
|
||||
sm_response *resp = (sm_response *) buf;
|
||||
resp->returnCode = 0;
|
||||
return write(*resp, 0);
|
||||
SMLogging* logger = SMLogging::get();
|
||||
int success;
|
||||
uint8_t buf[1024] = {0};
|
||||
|
||||
if (getLength() > 1023)
|
||||
{
|
||||
handleError("UnlinkTask read", ENAMETOOLONG);
|
||||
return true;
|
||||
}
|
||||
|
||||
success = read(buf, getLength());
|
||||
check_error("UnlinkTask read", false);
|
||||
unlink_cmd* cmd = (unlink_cmd*)buf;
|
||||
|
||||
#ifdef SM_TRACE
|
||||
logger->log(LOG_DEBUG, "unlink %s.", cmd->filename);
|
||||
#endif
|
||||
int err;
|
||||
|
||||
try
|
||||
{
|
||||
err = ioc->unlink(cmd->filename);
|
||||
}
|
||||
catch (exception& e)
|
||||
{
|
||||
logger->log(LOG_ERR, "UnlinkTask: caught '%s'", e.what());
|
||||
errno = EIO;
|
||||
err = -1;
|
||||
}
|
||||
|
||||
if (err)
|
||||
{
|
||||
handleError("UnlinkTask unlink", errno);
|
||||
return true;
|
||||
}
|
||||
|
||||
sm_response* resp = (sm_response*)buf;
|
||||
resp->returnCode = 0;
|
||||
return write(*resp, 0);
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace storagemanager
|
||||
|
Reference in New Issue
Block a user