/**
* This is the common functionality used to put a password generated key into
* the keyring, shared by both non-interactive and interactive signature
* generation code.
*
* Returns 0 on add, 1 on pre-existed, negative on failure.
*/
int ecryptfs_add_passphrase_key_to_keyring(char *auth_tok_sig, char *passphrase, char *salt)
{
...
So I think we just need to test the return code for <0.
Actually:
/** add_passphrase_ key_to_ keyring( char *auth_tok_sig, char *passphrase,
char *salt)
* This is the common functionality used to put a password generated key into
* the keyring, shared by both non-interactive and interactive signature
* generation code.
*
* Returns 0 on add, 1 on pre-existed, negative on failure.
*/
int ecryptfs_
{
...
So I think we just need to test the return code for <0.