Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
systemd
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
steam
systemd
Commits
6807947e
Commit
6807947e
authored
Apr 05, 2013
by
Lennart Poettering
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bus: don't allow recursive invocation of sd_bus_process()
parent
4b9c5220
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
+10
-2
src/libsystemd-bus/bus-internal.h
src/libsystemd-bus/bus-internal.h
+1
-0
src/libsystemd-bus/sd-bus.c
src/libsystemd-bus/sd-bus.c
+9
-1
src/systemd/sd-bus.h
src/systemd/sd-bus.h
+0
-1
No files found.
src/libsystemd-bus/bus-internal.h
View file @
6807947e
...
...
@@ -85,6 +85,7 @@ struct sd_bus {
bool
anonymous_auth
:
1
;
bool
prefer_readv
:
1
;
bool
prefer_writev
:
1
;
bool
processing
:
1
;
void
*
rbuffer
;
size_t
rbuffer_size
;
...
...
src/libsystemd-bus/sd-bus.c
View file @
6807947e
...
...
@@ -1845,6 +1845,10 @@ int sd_bus_process(sd_bus *bus, sd_bus_message **ret) {
if
(
bus
->
input_fd
<
0
)
return
-
ENOTCONN
;
/* We don't allow recursively invoking sd_bus_process(). */
if
(
bus
->
processing
)
return
-
EBUSY
;
switch
(
bus
->
state
)
{
case
BUS_UNSET
:
...
...
@@ -1870,7 +1874,11 @@ int sd_bus_process(sd_bus *bus, sd_bus_message **ret) {
case
BUS_RUNNING
:
case
BUS_HELLO
:
return
process_running
(
bus
,
ret
);
bus
->
processing
=
true
;
r
=
process_running
(
bus
,
ret
);
bus
->
processing
=
false
;
return
r
;
}
assert_not_reached
(
"Unknown state"
);
...
...
src/systemd/sd-bus.h
View file @
6807947e
...
...
@@ -34,7 +34,6 @@ extern "C" {
/* TODO:
* - allow registration/removl of callbacks from within callbacks
* - don't allow recursive processing
*
* - add page donation logic
* - api for appending/reading fixed arrays
...
...
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