mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-06-11 12:56:21 +09:00
priv: Introduce SSH_LOG_STRERROR to avoid repetitive code
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -271,6 +271,14 @@ void ssh_log_function(int verbosity,
|
||||
const char *buffer);
|
||||
#define SSH_LOG(priority, ...) \
|
||||
_ssh_log(priority, __func__, __VA_ARGS__)
|
||||
#define SSH_LOG_STRERROR(priority, errnum, ...) \
|
||||
do { \
|
||||
char err_msg[SSH_ERRNO_MSG_MAX] = {0}; \
|
||||
_ssh_log(priority, \
|
||||
__func__, \
|
||||
__VA_ARGS__, \
|
||||
ssh_strerror(errnum, err_msg, SSH_ERRNO_MSG_MAX)); \
|
||||
} while (0)
|
||||
|
||||
/* LEGACY */
|
||||
void ssh_log_common(struct ssh_common_struct *common,
|
||||
|
||||
Reference in New Issue
Block a user