mirror of https://gitee.com/bigwinds/arangodb
fix file permissions for VERSION file (#4823)
This commit is contained in:
parent
cf5ca07ff9
commit
c2cda95ce6
|
@ -23,6 +23,7 @@
|
|||
#include "Version.h"
|
||||
#include "Basics/Common.h"
|
||||
#include "Basics/FileUtils.h"
|
||||
#include "Basics/VelocyPackHelper.h"
|
||||
#include "Basics/files.h"
|
||||
#include "Logger/Logger.h"
|
||||
#include "Rest/Version.h"
|
||||
|
@ -163,6 +164,5 @@ void Version::write(TRI_vocbase_t* vocbase,
|
|||
builder.close();
|
||||
builder.close();
|
||||
|
||||
std::string json = builder.slice().toJson();
|
||||
basics::FileUtils::spit(versionFile, json.c_str(), json.length());
|
||||
basics::VelocyPackHelper::velocyPackToFile(versionFile, builder.slice(), true);
|
||||
}
|
||||
|
|
|
@ -187,13 +187,12 @@ void slurp(std::string const& filename, StringBuffer& result) {
|
|||
|
||||
static void throwFileWriteError(std::string const& filename) {
|
||||
TRI_set_errno(TRI_ERROR_SYS_ERROR);
|
||||
int res = TRI_errno();
|
||||
/*int res = */ TRI_errno();
|
||||
|
||||
std::string message("write failed for file '" + filename + "': " +
|
||||
strerror(res));
|
||||
std::string message("write failed for file '" + filename + "': " + TRI_last_error());
|
||||
LOG_TOPIC(TRACE, arangodb::Logger::FIXME) << "" << message;
|
||||
|
||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_SYS_ERROR);
|
||||
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_SYS_ERROR, message);
|
||||
}
|
||||
|
||||
void spit(std::string const& filename, char const* ptr, size_t len, bool sync) {
|
||||
|
|
Loading…
Reference in New Issue