From c3b77fba25539c433c882d980169f2c68329e996 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sat, 4 Jul 2015 17:38:57 +0200 Subject: Linux: Support checking/reparing mounted filesystem on KDE when xterm not available --- src/Core/Unix/CoreUnix.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/Core/Unix') diff --git a/src/Core/Unix/CoreUnix.cpp b/src/Core/Unix/CoreUnix.cpp index a6d1236a..73439a4a 100644 --- a/src/Core/Unix/CoreUnix.cpp +++ b/src/Core/Unix/CoreUnix.cpp @@ -61,6 +61,31 @@ namespace VeraCrypt { Process::Execute ("xterm", args, 1000); } catch (TimeOut&) { } +#ifdef TC_LINUX + catch (SystemException&) + { + // xterm not available. Try with KDE konsole if it exists + struct stat sb; + if (stat("/usr/bin/konsole", &sb) == 0) + { + args.clear (); + args.push_back ("--title"); + args.push_back ("fsck"); + args.push_back ("--caption"); + args.push_back ("fsck"); + args.push_back ("-e"); + args.push_back ("sh"); + args.push_back ("-c"); + args.push_back (xargs); + try + { + Process::Execute ("konsole", args, 1000); + } catch (TimeOut&) { } + } + else + throw; + } +#endif } void CoreUnix::DismountFilesystem (const DirectoryPath &mountPoint, bool force) const -- cgit v1.2.3