QH_ABORT_ON_ERRNO()

Updated: April 19, 2023

A convenience macro that allows you to call qh_abort_on_errno() without specifying qh_log_info

Synopsis:

#include <qh/error.h>
#define QH_ABORT_ON_ERRNO(errno,
                          err_msg)

Arguments:

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 prior to aborting, in case of failure.

Library:

qh

Description:

This macro defines for the caller the qh_log_info_t structure that you use with qh_abort_on_errno() with a few default parameters. These parameters make the log message show the originating location of the abort call in case of failure.