qh_abort_on_errno()

Updated: April 19, 2023

Conditionally log an error message using QNX helpers logging functions and then call abort() if the specified errno is not EOK

Synopsis:

#include <qh/error.h>
void qh_abort_on_errno(const qh_log_info_t *qh_log_info,
                       int errno,
                       const char *err_msg)

Arguments:

qh_log_info
The logging information for the abort message.
errno
The standard errno to validate (and log, in case of failure). Passing a value smaller than 0 (EOK) logs an error without details about the errno and aborts.
err_msg
The message to log before aborting, in case of failure.

Library:

qh

Description:

If the errno specified by errno is not EOK, this function logs an error message and then calls abort(). If errno is EOK, the function does nothing.

Returns:

None