From c5e8c37588ad7ec1769a6ac1142c396491752695 Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Wed, 12 Nov 2014 12:27:23 +0100 Subject: [PATCH] mkdir --- src/CryFuse.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/CryFuse.cpp b/src/CryFuse.cpp index 7188fa16..8cab4910 100644 --- a/src/CryFuse.cpp +++ b/src/CryFuse.cpp @@ -80,12 +80,14 @@ int CryFuse::mknod(const path &path, mode_t mode, dev_t rdev) { return 0; } -//TODO int CryFuse::mkdir(const path &path, mode_t mode) { //printf("mkdir(%s, %d)\n", path.c_str(), mode); - auto real_path = _device->RootDir() / path; - int retstat = ::mkdir(real_path.c_str(), mode); - return errcode_map(retstat); + try { + _device->mkdir(path, mode); + return 0; + } catch(cryfs::CryErrnoException &e) { + return -e.getErrno(); + } } //TODO