Skip to content

Commit

Permalink
fix: [disc] cannot unmount if device is busy
Browse files Browse the repository at this point in the history
force unmount

Log: fix cannot unmount if device is busy

Bug: https://pms.uniontech.com/bug-view-238157.html
  • Loading branch information
Johnson-zs committed Jan 3, 2024
1 parent e4b6222 commit 19d7a3c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/plugins/filemanager/dfmplugin-optical/optical.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,9 @@ void Optical::onDiscEjected(const QString &id)
const QString &mnt { DeviceUtils::getMountInfo(devFile) };
if (!mnt.isEmpty()) {
fmWarning() << "The device" << id << "has been ejected, but it's still mounted";
DeviceManager::instance()->unmountBlockDevAsync(id);
// cannot unmount if device is busy,
// so use { "force": GLib.Variant('b', True) }
DeviceManager::instance()->unmountBlockDevAsync(id, { { "force", true } });
}
}
} // namespace dfmplugin_optical

0 comments on commit 19d7a3c

Please sign in to comment.