summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2013-05-12 16:47:40 +0200
committerSlávek Banko <slavek.banko@axis.cz>2013-05-12 16:57:11 +0200
commit63d5f6882271eb8aa9b9b5744604cae1b38c3663 (patch)
tree23f152129e638251f2235be118930235f1dd1484
parent073a32f977df59e69253b71f2de9fe7a5ee0f43e (diff)
downloadtdebase-63d5f6882271eb8aa9b9b5744604cae1b38c3663.tar.gz
tdebase-63d5f6882271eb8aa9b9b5744604cae1b38c3663.zip
Fix halbackend does not manage to invoke 'fuser' command
(cherry picked from commit 42fc3b28988488dfefc5815b8efd265dba5b125a)
-rw-r--r--kioslave/media/mediamanager/halbackend.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/kioslave/media/mediamanager/halbackend.cpp b/kioslave/media/mediamanager/halbackend.cpp
index 7dd43a859..0aeb41003 100644
--- a/kioslave/media/mediamanager/halbackend.cpp
+++ b/kioslave/media/mediamanager/halbackend.cpp
@@ -1299,10 +1299,14 @@ static TQString mount_priv(const char *udi, const char *mount_point, const char
TQString HALBackend::listUsingProcesses(const Medium* medium)
{
TQString proclist, fullmsg;
- TQString cmdline = TQString("/usr/bin/env fuser -vm %1 2>&1").arg(KProcess::quote(medium->mountPoint()));
- FILE *fuser = popen(cmdline.latin1(), "r");
+ TQString fuserpath = KStandardDirs::findExe("fuser", TQString("/sbin:/usr/sbin:") + getenv( "PATH" ));
+ FILE *fuser = NULL;
uint counter = 0;
+ if (!fuserpath.isEmpty()) {
+ TQString cmdline = TQString("/usr/bin/env %1 -vm %2 2>&1").arg(fuserpath, KProcess::quote(medium->mountPoint()));
+ fuser = popen(cmdline.latin1(), "r");
+ }
if (fuser) {
proclist += "<pre>";
TQTextIStream is(fuser);
@@ -1336,10 +1340,14 @@ TQString HALBackend::listUsingProcesses(const Medium* medium)
TQString HALBackend::killUsingProcesses(const Medium* medium)
{
TQString proclist, fullmsg;
- TQString cmdline = TQString("/usr/bin/env fuser -vmk %1 2>&1").arg(KProcess::quote(medium->mountPoint()));
- FILE *fuser = popen(cmdline.latin1(), "r");
+ TQString fuserpath = KStandardDirs::findExe("fuser", TQString("/sbin:/usr/sbin:") + getenv( "PATH" ));
+ FILE *fuser = NULL;
uint counter = 0;
+ if (!fuserpath.isEmpty()) {
+ TQString cmdline = TQString("/usr/bin/env %1 -vmk %2 2>&1").arg(fuserpath, KProcess::quote(medium->mountPoint()));
+ fuser = popen(cmdline.latin1(), "r");
+ }
if (fuser) {
proclist += "<pre>";
TQTextIStream is(fuser);