From 8182a45d65b81cecfb49470c64f7c106b0a42b96 Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Tue, 11 Nov 2014 00:38:33 +0100 Subject: [PATCH] Fix create! --- src/cryfs_lib/CryDevice.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cryfs_lib/CryDevice.cpp b/src/cryfs_lib/CryDevice.cpp index dfdd7b03..9b784689 100644 --- a/src/cryfs_lib/CryDevice.cpp +++ b/src/cryfs_lib/CryDevice.cpp @@ -1,6 +1,7 @@ #include "../cryfs_lib/CryDevice.h" #include +#include #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); }