mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
soliduiserver: do not use umount2() for unmounting
umount2() does not work for removed devices and a mount-point cleaner will be implemented soon Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
ab1d46e3c7
commit
09f7754713
1 changed files with 0 additions and 17 deletions
|
@ -25,11 +25,6 @@
|
|||
#include <QDir>
|
||||
#include <QCoreApplication>
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
# include <sys/mount.h>
|
||||
# include <errno.h>
|
||||
#endif
|
||||
|
||||
SolidUiServerHelper::SolidUiServerHelper(const char* const helper, QObject *parent)
|
||||
: KAuthorization(helper, parent)
|
||||
{
|
||||
|
@ -142,17 +137,6 @@ int SolidUiServerHelper::unmount(const QVariantMap ¶meters)
|
|||
}
|
||||
|
||||
const QString mountpoint = parameters.value("mountpoint").toString();
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
const QByteArray mountpointbytes = mountpoint.toLocal8Bit();
|
||||
const int umountresult = ::umount2(mountpointbytes.constData(), 0);
|
||||
if (umountresult == 0) {
|
||||
return KAuthorization::NoError;
|
||||
}
|
||||
const int savederrno = errno;
|
||||
kWarning() << qt_error_string(savederrno);
|
||||
return KAuthorization::HelperError;
|
||||
#else
|
||||
const QStringList umountargs = QStringList() << mountpoint;
|
||||
QProcess umountproc;
|
||||
umountproc.start("umount", umountargs);
|
||||
|
@ -168,7 +152,6 @@ int SolidUiServerHelper::unmount(const QVariantMap ¶meters)
|
|||
}
|
||||
kWarning() << umounterror;
|
||||
return KAuthorization::HelperError;
|
||||
#endif // Q_OS_LINUX
|
||||
}
|
||||
|
||||
K_AUTH_MAIN("org.kde.soliduiserver.mountunmounthelper", SolidUiServerHelper)
|
||||
|
|
Loading…
Add table
Reference in a new issue