summaryrefslogtreecommitdiffstats
path: root/src/basic/log.h
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2022-10-21 14:18:44 +0200
committerDaan De Meyer <daan.j.demeyer@gmail.com>2022-11-10 17:49:34 +0100
commitfa83506d5063c5cae2529f59bdf8fff3c0b591ea (patch)
tree9c404d431ac170a66dccfa8b07d823761abb63ea /src/basic/log.h
parentbuild: Use -fstrict-flex-arrays=1 if supported (diff)
downloadsystemd-fa83506d5063c5cae2529f59bdf8fff3c0b591ea.tar.xz
systemd-fa83506d5063c5cae2529f59bdf8fff3c0b591ea.zip
log: Use ##__VA_ARGS__ in ratelimit log macros
This allows us to call these without formatting arguments.
Diffstat (limited to 'src/basic/log.h')
-rw-r--r--src/basic/log.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/basic/log.h b/src/basic/log.h
index c51941c141..96fcc0fdaf 100644
--- a/src/basic/log.h
+++ b/src/basic/log.h
@@ -393,8 +393,8 @@ typedef struct LogRateLimit {
} \
if (ratelimit_below(&_log_ratelimit.ratelimit)) \
_log_ratelimit_error = _num_dropped_errors > 0 \
- ? log_internal(_log_ratelimit_level, _log_ratelimit_error, _file, _line, _func, _format " (Dropped %u similar message(s))", __VA_ARGS__, _num_dropped_errors) \
- : log_internal(_log_ratelimit_level, _log_ratelimit_error, _file, _line, _func, _format, __VA_ARGS__); \
+ ? log_internal(_log_ratelimit_level, _log_ratelimit_error, _file, _line, _func, _format " (Dropped %u similar message(s))", ##__VA_ARGS__, _num_dropped_errors) \
+ : log_internal(_log_ratelimit_level, _log_ratelimit_error, _file, _line, _func, _format, ##__VA_ARGS__); \
_log_ratelimit_error; \
})
@@ -402,7 +402,7 @@ typedef struct LogRateLimit {
({ \
int _level = (level), _e = (error); \
_e = (log_get_max_level() >= LOG_PRI(_level)) \
- ? log_ratelimit_internal(_level, _e, format, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
+ ? log_ratelimit_internal(_level, _e, format, PROJECT_FILE, __LINE__, __func__, ##__VA_ARGS__) \
: -ERRNO_VALUE(_e); \
_e < 0 ? _e : -ESTRPIPE; \
})