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