umount卸载目录挂载
This commit is contained in:
parent
a818cf00e1
commit
7ef30fd92c
|
@ -72,12 +72,20 @@ bool MountBackupProcess::umountBackupPartition()
|
|||
*/
|
||||
bool MountBackupProcess::umount(const QString& mountPath)
|
||||
{
|
||||
if (0 == ::umount(mountPath.toUtf8().data()))
|
||||
return true;
|
||||
QStringList arguments;
|
||||
arguments << mountPath;
|
||||
m_p->start("umount", arguments);
|
||||
if (!m_p->waitForStarted()) {
|
||||
qCritical() << tr("umount %1 process start failed!").arg(mountPath);
|
||||
return false;
|
||||
}
|
||||
|
||||
qCritical() << QString("%1 umount failed, error is %2(%3)").arg(mountPath).arg(strerror(errno)).arg(QString::number(errno));
|
||||
if (!m_p->waitForFinished()) {
|
||||
qCritical() << tr("umount %1 process end failed!").arg(mountPath);
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue