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
7901b04c
Commit
7901b04c
authored
Oct 14, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
event/SocketEvent: allow Cancel() without socket
parent
653eea58
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
11 deletions
+6
-11
SocketEvent.cxx
src/event/SocketEvent.cxx
+2
-8
SocketEvent.hxx
src/event/SocketEvent.hxx
+3
-1
Watch.cxx
src/lib/dbus/Watch.cxx
+1
-2
No files found.
src/event/SocketEvent.cxx
View file @
7901b04c
...
...
@@ -38,12 +38,6 @@ SocketEvent::Dispatch() noexcept
callback
(
flags
);
}
SocketEvent
::~
SocketEvent
()
noexcept
{
if
(
IsDefined
())
Cancel
();
}
void
SocketEvent
::
Open
(
SocketDescriptor
_fd
)
noexcept
{
...
...
@@ -72,11 +66,11 @@ SocketEvent::Close() noexcept
bool
SocketEvent
::
Schedule
(
unsigned
flags
)
noexcept
{
assert
(
IsDefined
());
if
(
flags
==
GetScheduledFlags
())
return
true
;
assert
(
IsDefined
());
bool
success
;
if
(
scheduled_flags
==
0
)
success
=
loop
.
AddFD
(
fd
.
Get
(),
flags
,
*
this
);
...
...
src/event/SocketEvent.hxx
View file @
7901b04c
...
...
@@ -91,7 +91,9 @@ public:
callback
(
_callback
),
fd
(
_fd
)
{}
~
SocketEvent
()
noexcept
;
~
SocketEvent
()
noexcept
{
Cancel
();
}
auto
&
GetEventLoop
()
const
noexcept
{
return
loop
;
...
...
src/lib/dbus/Watch.cxx
View file @
7901b04c
...
...
@@ -52,8 +52,7 @@ DbusToLibevent(unsigned flags) noexcept
void
WatchManager
::
Watch
::
Toggled
()
noexcept
{
if
(
event
.
IsDefined
())
event
.
Cancel
();
event
.
Cancel
();
if
(
dbus_watch_get_enabled
(
&
watch
))
{
event
.
Open
(
SocketDescriptor
(
dbus_watch_get_unix_fd
(
&
watch
)));
...
...
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