From: Lukasz Pawelczyk Date: Mon, 4 Sep 2017 13:16:51 +0000 (+0200) Subject: Catch internal mount/umount error messages X-Git-Tag: submit/tizen/20170918.080130~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=abfe83d16f5ee329393e6d3793b7438285b64946;p=platform%2Fcore%2Fsecurity%2Fode.git Catch internal mount/umount error messages Change-Id: Ic72c3352914600b2bdafa270600e556c0e9385e8 --- diff --git a/server/internal-encryption.cpp b/server/internal-encryption.cpp index cfb9099..7704078 100644 --- a/server/internal-encryption.cpp +++ b/server/internal-encryption.cpp @@ -272,13 +272,19 @@ int InternalEncryption::mount() return 0; } - engine->mount(mountKey, getOptions()); - mountKey.clear(); + try { + INFO(SINK, "Mount internal storage..."); + engine->mount(mountKey, getOptions()); + mountKey.clear(); - context.notify("InternalEncryption::mount"); + context.notify("InternalEncryption::mount"); - runtime::File("/tmp/.lazy_mount").create(O_WRONLY); - runtime::File("/tmp/.unlock_mnt").create(O_WRONLY); + runtime::File("/tmp/.lazy_mount").create(O_WRONLY); + runtime::File("/tmp/.unlock_mnt").create(O_WRONLY); + } catch (runtime::Exception &e) { + ERROR(SINK, "Mount failed - " + std::string(e.what())); + return -1; + } return 0; } @@ -294,10 +300,15 @@ int InternalEncryption::umount() return 0; } - INFO(SINK, "Close all processes using internal storage..."); - stopDependedSystemdServices(); - INFO(SINK, "Umount internal storage..."); - engine->umount(); + try { + INFO(SINK, "Close all processes using internal storage..."); + stopDependedSystemdServices(); + INFO(SINK, "Umount internal storage..."); + engine->umount(); + } catch (runtime::Exception &e) { + ERROR(SINK, "Umount failed - " + std::string(e.what())); + return -1; + } return 0; }