nix_err_code: do not fail

This commit is contained in:
Yorick van Pelt 2023-07-30 16:46:20 +02:00 committed by José Luis Lafuente
parent b0741f7128
commit f41a7e326b
No known key found for this signature in database
GPG key ID: 8A3455EBE455489A
2 changed files with 4 additions and 7 deletions

View file

@ -127,10 +127,7 @@ nix_err nix_err_info_msg(nix_c_context *context,
n);
}
nix_err nix_err_code(nix_c_context *context,
const nix_c_context *read_context) {
if (context)
context->last_err_code = NIX_OK;
nix_err nix_err_code(const nix_c_context *read_context) {
return read_context->last_err_code;
}

View file

@ -253,12 +253,12 @@ nix_err nix_err_name(nix_c_context *context, const nix_c_context *read_context,
*
* Equivalent to reading the first field of the context.
*
* @param[out] context optional, the context to store errors in if this function
* fails
* Does not fail
*
* @param[in] read_context the context to retrieve the error message from
* @return most recent error code stored in the context.
*/
nix_err nix_err_code(nix_c_context *context, const nix_c_context *read_context);
nix_err nix_err_code(const nix_c_context *read_context);
/**
* @}