diff options
author | Roman Rakus <rrakus@redhat.com> | 2013-06-12 15:28:38 +0200 |
---|---|---|
committer | Roman Rakus <rrakus@redhat.com> | 2013-06-12 15:50:35 +0200 |
commit | ec58653e83ba32cba3a3f51d9fcedca4873c7ab7 (patch) | |
tree | a2bc5f2922dec675835602d0ea12fcdf66847597 /src/account/LMI_IdentityProvider.c | |
parent | ccb095d49a35b001439c254beebf5ba4e57e89e0 (diff) | |
download | openlmi-providers-ec58653e83ba32cba3a3f51d9fcedca4873c7ab7.tar.gz openlmi-providers-ec58653e83ba32cba3a3f51d9fcedca4873c7ab7.tar.xz openlmi-providers-ec58653e83ba32cba3a3f51d9fcedca4873c7ab7.zip |
Account: Use KReturn2 instead of CMReturnWithChars
KReturn2 now supports valist so we don't need to use temp variables
Signed-off-by: Roman Rakus <rrakus@redhat.com>
Diffstat (limited to 'src/account/LMI_IdentityProvider.c')
-rw-r--r-- | src/account/LMI_IdentityProvider.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/account/LMI_IdentityProvider.c b/src/account/LMI_IdentityProvider.c index 92c2b01..b359a69 100644 --- a/src/account/LMI_IdentityProvider.c +++ b/src/account/LMI_IdentityProvider.c @@ -159,7 +159,6 @@ static CMPIStatus LMI_IdentityDeleteInstance( LMI_Identity identity; const char* instance_id = NULL; id_t id; - char errmsg[256]; struct lu_context *luc = NULL; struct lu_error *error = NULL; struct lu_ent *lue = NULL; @@ -180,21 +179,19 @@ static CMPIStatus LMI_IdentityDeleteInstance( { /* It's a group */ if (!lu_group_lookup_id(luc, id, lue, &error)) { /* User with that ID is not present */ - snprintf(errmsg, 256, "Non existing group id: %d\n", id); lu_ent_free(lue); lu_end(luc); - CMReturnWithChars(_cb, CMPI_RC_ERR_NOT_FOUND, errmsg); + KReturn2(_cb, ERR_NOT_FOUND, "Non existing group id: %d\n", id); } else { if (!lu_group_delete(luc, lue, &error)) { /* user delete error */ - snprintf(errmsg, 256, - "Group with id %d could not be deleted: %s\n", id, - lu_strerror(error)); lu_ent_free(lue); lu_end(luc); - CMReturnWithChars(_cb, CMPI_RC_ERR_FAILED, errmsg); + KReturn2(_cb, ERR_FAILED, + "Group with id %d could not be deleted: %s\n", id, + lu_strerror(error)); } } } @@ -202,21 +199,19 @@ static CMPIStatus LMI_IdentityDeleteInstance( { /* It's an user */ if (!lu_user_lookup_id(luc, id, lue, &error)) { /* User with that ID is not present */ - snprintf(errmsg, 256, "Non existing user id: %d\n", id); lu_ent_free(lue); lu_end(luc); - CMReturnWithChars(_cb, CMPI_RC_ERR_NOT_FOUND, errmsg); + KReturn2(_cb, ERR_NOT_FOUND, "Non existing user id: %d\n", id); } else { if (!lu_user_delete(luc, lue, &error)) { /* user delete error */ - snprintf(errmsg, 256, - "User with id %d could not be deleted: %s\n", id, - lu_strerror(error)); lu_ent_free(lue); lu_end(luc); - CMReturnWithChars(_cb, CMPI_RC_ERR_FAILED, errmsg); + KReturn2(_cb, ERR_FAILED, + "User with id %d could not be deleted: %s\n", id, + lu_strerror(error)); } } } |