log: assign the realm to a variable first in log_full_errno_realm()

Let's avoid duplicate evaluation (which might have side-effects) and
assign the realm to an internal variable first, as we need it twice.
This commit is contained in:
Lennart Poettering 2018-01-11 13:15:19 +01:00
parent d04ce5a9c4
commit c1e83af84e
1 changed files with 3 additions and 3 deletions

View File

@ -238,9 +238,9 @@ void log_assert_failed_return_realm(
/* Logging with level */
#define log_full_errno_realm(realm, level, error, ...) \
({ \
int _level = (level), _e = (error); \
(log_get_max_level_realm((realm)) >= LOG_PRI(_level)) \
? log_internal_realm(LOG_REALM_PLUS_LEVEL((realm), _level), _e, \
int _level = (level), _e = (error), _realm = (realm); \
(log_get_max_level_realm(_realm) >= LOG_PRI(_level)) \
? log_internal_realm(LOG_REALM_PLUS_LEVEL(_realm, _level), _e, \
__FILE__, __LINE__, __func__, __VA_ARGS__) \
: -abs(_e); \
})