Libelektra: Plugin Functions: Return Value on Success

Created on 28 Feb 2017  ·  4Comments  ·  Source: ElektraInitiative/libelektra

👋 Hi,

the documentation states that elektraPluginGet should return 0 on success, yet the template suggests – since commit 📜 062e017e – that plugin functions should return 1 on success.

Other plugins also use 1 to show that functions were successful, as far as I can tell. The tcl plugin on the other hand returns 0 on success. Which return value is the correct one?

question usability

Most helpful comment

both are correct
1 for success + keyset updated
0 for success but nothing changed
-1 for error

All 4 comments

both are correct
1 for success + keyset updated
0 for success but nothing changed
-1 for error

both are correct…

Thank you for the quick response. I will update the documentation accordingly.

I suggest to also add a note to the template, because it is trivial enough to not require to dive into a huge documentation:

//  1 for success + keyset updated
//  0 for success without changes
// -1 for error
return 1;

I suggest to also add a note to the template, because it is trivial enough to not require to dive into a huge documentation…

Good idea. I just added the information to elektraTemplateGet in my local branch of the repo.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mpranj picture mpranj  ·  3Comments

sanssecours picture sanssecours  ·  3Comments

markus2330 picture markus2330  ·  4Comments

markus2330 picture markus2330  ·  3Comments

sanssecours picture sanssecours  ·  4Comments