Fix create!

This commit is contained in:
Sebastian Messmer 2014-11-11 00:38:33 +01:00
parent a8604d7b58
commit 8182a45d65

View File

@ -1,6 +1,7 @@
#include "../cryfs_lib/CryDevice.h"
#include <memory>
#include <fcntl.h>
#include "CryDir.h"
#include "CryFile.h"
@ -99,5 +100,5 @@ int CryDevice::createAndOpenFile(const bf::path &path, mode_t mode) {
// This is slow. Improve!
auto dir = LoadDir(path.parent_path());
dir->createFile(path.filename().native(), mode);
return openFile(path, mode);
return openFile(path, O_CREAT | O_WRONLY | O_TRUNC);
}