summaryrefslogtreecommitdiffstats
path: root/tdeioslave/media
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2013-05-12 16:49:23 +0200
committerSlávek Banko <slavek.banko@axis.cz>2013-05-12 16:49:23 +0200
commit134af52f38eba04b8608ab0410dae8111ea4e5b8 (patch)
tree9299f53c1a5f059b8886ad4921f4a171eb41ea2f /tdeioslave/media
parent42fc3b28988488dfefc5815b8efd265dba5b125a (diff)
downloadtdebase-134af52f38eba04b8608ab0410dae8111ea4e5b8.tar.gz
tdebase-134af52f38eba04b8608ab0410dae8111ea4e5b8.zip
Fix tdehardwarebackend does not manage to invoke 'fuser' command
Diffstat (limited to 'tdeioslave/media')
-rw-r--r--tdeioslave/media/mediamanager/tdehardwarebackend.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/tdeioslave/media/mediamanager/tdehardwarebackend.cpp b/tdeioslave/media/mediamanager/tdehardwarebackend.cpp
index 625b4e251..f793095fb 100644
--- a/tdeioslave/media/mediamanager/tdehardwarebackend.cpp
+++ b/tdeioslave/media/mediamanager/tdehardwarebackend.cpp
@@ -1257,10 +1257,14 @@ TQString TDEBackend::isInFstab(const Medium *medium)
TQString TDEBackend::listUsingProcesses(const Medium* medium)
{
TQString proclist, fullmsg;
- TQString cmdline = TQString("/usr/bin/env fuser -vm %1 2>&1").arg(TDEProcess::quote(medium->mountPoint()));
- FILE *fuser = popen(cmdline.latin1(), "r");
+ TQString fuserpath = TDEStandardDirs::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, TDEProcess::quote(medium->mountPoint()));
+ fuser = popen(cmdline.latin1(), "r");
+ }
if (fuser) {
proclist += "<pre>";
TQTextIStream is(fuser);
@@ -1294,10 +1298,14 @@ TQString TDEBackend::listUsingProcesses(const Medium* medium)
TQString TDEBackend::killUsingProcesses(const Medium* medium)
{
TQString proclist, fullmsg;
- TQString cmdline = TQString("/usr/bin/env fuser -vmk %1 2>&1").arg(TDEProcess::quote(medium->mountPoint()));
- FILE *fuser = popen(cmdline.latin1(), "r");
+ TQString fuserpath = TDEStandardDirs::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, TDEProcess::quote(medium->mountPoint()));
+ fuser = popen(cmdline.latin1(), "r");
+ }
if (fuser) {
proclist += "<pre>";
TQTextIStream is(fuser);