Skip to content

install: make InstallChangeType enum a proper enum - #25002

Merged
bluca merged 2 commits into
systemd:mainfrom
poettering:install-type-fix
Oct 14, 2022
Merged

bluca merged 2 commits into
systemd:mainfrom
poettering:install-type-fix

Conversation

@poettering

Copy link
Copy Markdown
Member

No description provided.

We can just make this an enum, as long as we ensure it has enough range,
which we can do by adding -ERRNO_MAX as one possible value (at least on
GNU C). We already do that at multiple other places, so let's do this
here too.
Typically the _MAX and _INVALID special enum values use the full type as
prefix, even if the actual values of the enum might not. Let's follow
this rule here too.
@bluca
bluca merged commit d2be5f6 into systemd:main Oct 14, 2022
@keszybz

keszybz commented Oct 24, 2022

Copy link
Copy Markdown
Member

Hmm, I don't like those changes particularly. I think change_or_errno did a pretty good job of explaining what the field contains, and with type you actually need to go and look at the sources or comments to figure out that it is a special field with dual use. The nature of this code is that people only look at it when they need to, i.e. when something breaks, so expanatory field names are more important than brevity. But I don't want to get into bikeshed territory. If both you and @bluca this it's better, then OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants