Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
bbaeea1a
Commit
bbaeea1a
authored
Feb 20, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage/udisks2: use existing mount point if already mounted
Fixes the "org.freedesktop.UDisks2.Error.AlreadyMounted" error. Closes #485
parent
0a3aee9d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
UdisksStorage.cxx
src/storage/plugins/UdisksStorage.cxx
+12
-1
No files found.
src/storage/plugins/UdisksStorage.cxx
View file @
bbaeea1a
...
...
@@ -156,16 +156,27 @@ UdisksStorage::OnListReply(ODBus::Message reply) noexcept
using
namespace
UDisks2
;
try
{
ParseObjects
(
reply
,
[
this
](
Object
&&
o
)
{
std
::
string
mount_point
;
ParseObjects
(
reply
,
[
this
,
&
mount_point
](
Object
&&
o
)
{
if
(
!
o
.
IsId
(
id
))
return
;
dbus_path
=
std
::
move
(
o
.
path
);
mount_point
=
std
::
move
(
o
.
mount_point
);
});
if
(
dbus_path
.
empty
())
throw
FormatRuntimeError
(
"No such UDisks2 object: %s"
,
id
.
c_str
());
if
(
!
mount_point
.
empty
())
{
/* already mounted: don't attempt to mount
again, because this would result in
org.freedesktop.UDisks2.Error.AlreadyMounted */
LockSetMountPoint
(
mount_point
.
c_str
());
return
;
}
}
catch
(...)
{
const
std
::
lock_guard
<
Mutex
>
lock
(
mutex
);
mount_error
=
std
::
current_exception
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment