Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dbus/download-pkgs: remove some goto statements #3298

Merged
merged 1 commit into from
Jan 4, 2022

Conversation

lucab
Copy link
Contributor

@lucab lucab commented Dec 23, 2021

This drops a bunch of goto codepaths from the DBus DownloadPackages
handler.
The same logic is now expressed with usual GError handling.
It aims at making future Rust integration easier by not having to deal
with non-linear execution flows.

static gboolean
osexperimental_handle_download_packages (RPMOSTreeOSExperimental *interface,
GDBusMethodInvocation *invocation,
GUnixFDList* _fds,
Copy link
Contributor Author

@lucab lucab Dec 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This argument seemed unused in the original code, but I think it's just the result of dbus funky way of handling "out" parameters.

@lucab lucab force-pushed the ups/dbus-ex-remove-gotos branch 2 times, most recently from 14c1e13 to e7afec3 Compare January 3, 2022 17:32
This drops a bunch of goto codepaths from the DBus DownloadPackages
handler.
The same logic is now expressed with usual GError handling.
It aims at making future Rust integration easier by not having to deal
with non-linear execution flows.
@lucab lucab force-pushed the ups/dbus-ex-remove-gotos branch from e7afec3 to 757f2f0 Compare January 4, 2022 09:29
Copy link
Member

@jmarrero jmarrero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

glnx_throw (&local_error, "No matches for \"%s\" in repo '%s'", pkg_name, source_name);
goto out;
}
return glnx_prefix_error (error, "No matches for \"%s\" in repo '%s'", pkg_name, source_name);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self note: this is wrong, should have been a glnx_throw() instead, see #3344.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants