mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
assert-util: drop message argument of assert_log()
As it is always equals to #expr.
This commit is contained in:
@@ -10,19 +10,20 @@ bool log_get_assert_return_is_critical(void) _pure_;
|
||||
|
||||
void log_assert_failed_return(const char *text, const char *file, int line, const char *func);
|
||||
|
||||
#define assert_log(expr, message) ((_likely_(expr)) \
|
||||
? (true) \
|
||||
: (log_assert_failed_return(message, PROJECT_FILE, __LINE__, __func__), false))
|
||||
#define assert_log(expr) \
|
||||
(_likely_(expr) ? \
|
||||
true : \
|
||||
(log_assert_failed_return(#expr, PROJECT_FILE, __LINE__, __func__), false))
|
||||
|
||||
#define assert_return(expr, r) \
|
||||
do { \
|
||||
if (!assert_log(expr, #expr)) \
|
||||
if (!assert_log(expr)) \
|
||||
return (r); \
|
||||
} while (false)
|
||||
|
||||
#define assert_return_errno(expr, r, err) \
|
||||
do { \
|
||||
if (!assert_log(expr, #expr)) { \
|
||||
if (!assert_log(expr)) { \
|
||||
errno = err; \
|
||||
return (r); \
|
||||
} \
|
||||
|
||||
@@ -50,7 +50,7 @@ static inline int __coverity_check_and_return__(int condition) {
|
||||
|
||||
#define assert_message_se(expr, message) __coverity_check__(!!(expr))
|
||||
|
||||
#define assert_log(expr, message) __coverity_check_and_return__(!!(expr))
|
||||
#define assert_log(expr) __coverity_check_and_return__(!!(expr))
|
||||
|
||||
#else /* ! __COVERITY__ */
|
||||
|
||||
|
||||
@@ -399,7 +399,7 @@ int bus_maybe_reply_error(sd_bus_message *m, int r, const sd_bus_error *e);
|
||||
|
||||
#define bus_assert_return(expr, r, error) \
|
||||
do { \
|
||||
if (!assert_log(expr, #expr)) \
|
||||
if (!assert_log(expr)) \
|
||||
return sd_bus_error_set_errno(error, r); \
|
||||
} while (false)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user