mirror of https://gitee.com/bigwinds/arangodb
fix failing directory sync for windows, by not executing it
This commit is contained in:
parent
1402395f1c
commit
704436de91
|
@ -677,6 +677,7 @@ bool VelocyPackHelper::velocyPackToFile(std::string const& filename,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
if (syncFile) {
|
if (syncFile) {
|
||||||
// also sync target directory
|
// also sync target directory
|
||||||
std::string const dir = TRI_Dirname(filename.c_str());
|
std::string const dir = TRI_Dirname(filename.c_str());
|
||||||
|
@ -684,21 +685,22 @@ bool VelocyPackHelper::velocyPackToFile(std::string const& filename,
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
TRI_set_errno(TRI_ERROR_SYS_ERROR);
|
TRI_set_errno(TRI_ERROR_SYS_ERROR);
|
||||||
LOG_TOPIC("fd84e", WARN, arangodb::Logger::FIXME)
|
LOG_TOPIC("fd84e", WARN, arangodb::Logger::FIXME)
|
||||||
<< "cannot sync directory '" << tmp << "': " << TRI_LAST_ERROR_STR;
|
<< "cannot sync directory '" << filename << "': " << TRI_LAST_ERROR_STR;
|
||||||
} else {
|
} else {
|
||||||
if (fsync(fd) < 0) {
|
if (fsync(fd) < 0) {
|
||||||
TRI_set_errno(TRI_ERROR_SYS_ERROR);
|
TRI_set_errno(TRI_ERROR_SYS_ERROR);
|
||||||
LOG_TOPIC("6b8f6", WARN, arangodb::Logger::FIXME)
|
LOG_TOPIC("6b8f6", WARN, arangodb::Logger::FIXME)
|
||||||
<< "cannot sync directory '" << tmp << "': " << TRI_LAST_ERROR_STR;
|
<< "cannot sync directory '" << filename << "': " << TRI_LAST_ERROR_STR;
|
||||||
}
|
}
|
||||||
res = TRI_CLOSE(fd);
|
res = TRI_CLOSE(fd);
|
||||||
if (res < 0) {
|
if (res < 0) {
|
||||||
TRI_set_errno(TRI_ERROR_SYS_ERROR);
|
TRI_set_errno(TRI_ERROR_SYS_ERROR);
|
||||||
LOG_TOPIC("7ceee", WARN, arangodb::Logger::FIXME)
|
LOG_TOPIC("7ceee", WARN, arangodb::Logger::FIXME)
|
||||||
<< "cannot close directory '" << dir << "': " << TRI_LAST_ERROR_STR;
|
<< "cannot close directory '" << filename << "': " << TRI_LAST_ERROR_STR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue