Repository navigation
core: add deserialize_fd() helper + other minor fixes - #29481
Merged
Merged
Conversation
bluca
reviewed
Oct 6, 2023
bluca
reviewed
Oct 6, 2023
bluca
reviewed
Oct 6, 2023
bluca
reviewed
Oct 6, 2023
YHNdnzj
reviewed
Oct 9, 2023
poettering
force-pushed
the
deserialize-fd
branch
from
October 10, 2023 21:44
f1fc931 to
a1ae728
Compare
Member
Author
|
Force pushed new version, with requested changes made. |
This comment was marked as resolved.
This comment was marked as resolved.
poettering
force-pushed
the
deserialize-fd
branch
2 times, most recently
from
October 11, 2023 13:56
79432cf to
986d1d9
Compare
poettering
force-pushed
the
deserialize-fd
branch
from
October 16, 2023 14:09
986d1d9 to
b9d14b0
Compare
bluca
approved these changes
Oct 16, 2023
Member
|
|
poettering
force-pushed
the
deserialize-fd
branch
from
October 17, 2023 12:42
b9d14b0 to
6ce14ae
Compare
bluca
reviewed
Oct 17, 2023
bluca
reviewed
Oct 17, 2023
bluca
reviewed
Oct 17, 2023
bluca
reviewed
Oct 17, 2023
poettering
force-pushed
the
deserialize-fd
branch
from
October 18, 2023 09:49
6ce14ae to
1c22995
Compare
bluca
reviewed
Oct 18, 2023
bluca
reviewed
Oct 18, 2023
Currently, when we deserialize an fd we do a lot of manual work. Add a common helper that makes this more robust and uniform. Note that this sometimes changes behaviour slightly, but in ways that shouldn't really matter: if we fail to deserialize an fd correctly we'll unset (i.e. set to -EBADF) the fd in the deserialized data structure. Previously, we'd leave the old value in place. This should not change effective result (as in either case we'll be in a bad state afterwards, just once we mix old/invalidated state with new state, while now we'll reset the state explicitly to invalidated state on failure). In particular as deserialization starts from an empty structure generally, hence the old value should be unset anyway. Another slight change is that if we fail to deserialize some object half way, and we already have taken out one fd from the serialized fdset we'll now just close it instead of returning it to/leaving it in the fdset. Given that such "orphaned" fds are blanket closed after deserialization finishes this also shouldn't change behaviour IRL. Also, the idle_pipe was previously incorrectly serialized: we'd serialize invalidated fds, which would fail, but because parsing errors on this were ignored on the deserializatin noone noticed. This is fixed.
Rename the return parameters "ret", and use compound initialization. Add an assert() on input.
The other deserializers put value first, and return parameter second, let's do so here too.
poettering
force-pushed
the
deserialize-fd
branch
from
October 18, 2023 10:54
1c22995 to
c2e42d4
Compare
bluca
approved these changes
Oct 18, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.