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

Invoke error key #1801

Merged
merged 3 commits into from
Jan 31, 2018
Merged

Conversation

e1528532
Copy link
Contributor

Purpose

Adds the possibility for the invoke library to report errors when trying to open/close a plugin as discussed in #1795 .

Checklist

  • commit messages are fine (with references to issues)
  • I added unit tests
  • I ran all tests and everything went fine
  • affected documentation is fixed
  • I added code comments, logging, and assertions (see doc/CODING.md)
  • meta data is updated (e.g. README.md of plugins)
  • release notes are updated (doc/news/_preparation_next_release.md)

@markus2330 As C doesn't support overloaded functions, i've adjusted the original interface now as its not a part of the core elektra library as far as i've understood because i think the function names fit pretty well. I've also adapted those few plugins using it already, but for those i am passing simply 0 as the error key so invoke will take care about the error key creation itself, which basically is the old behavior to avoid possibly breaking anything in plugins i do not maintain. For my own plugins i've incorporated the new error key already (and even had to do a small pluginprocess library adjustment.

}
else
{
keyIncRef (errorKey);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this needed? Who decrements the reference?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In every case keyDel (errorKey) is called. If the user has passed a key, the reference is increased beforehand so the user's passed key won't get deleted at this point. If the user passed 0, a key was created inside the invoke library and it will be deleted.

@e1528532
Copy link
Contributor Author

any objections? otherwise ready to merge

@markus2330 markus2330 merged commit a5e2297 into ElektraInitiative:master Jan 31, 2018
@markus2330
Copy link
Contributor

Thank you, great job!

@e1528532 e1528532 mentioned this pull request Feb 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants