summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2012-07-26 14:07:27 +0200
committerMichal Schmidt <mschmidt@redhat.com>2012-07-26 14:07:27 +0200
commitcd6f1c0f87fd3e3345e51476e25cd1104efb7fa3 (patch)
tree780b2763cc678894f4bf796f4f90b30152208427 /src
parente239cd8de06a62c9adc71ff1329a1ce76e8735a5 (diff)
log: log_oom() must be a macro
Diffstat (limited to 'src')
-rw-r--r--src/shared/log.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/shared/log.h b/src/shared/log.h
index 7bdb3e086..7c3376c31 100644
--- a/src/shared/log.h
+++ b/src/shared/log.h
@@ -103,10 +103,11 @@ int log_dump_internal(
#define log_warning(...) log_meta(LOG_WARNING, __FILE__, __LINE__, __func__, __VA_ARGS__)
#define log_error(...) log_meta(LOG_ERR, __FILE__, __LINE__, __func__, __VA_ARGS__)
-static inline int log_oom(void) {
- log_error("Out of memory.");
- return -ENOMEM;
-}
+/* This must be a macro for __LINE__ etc. to work */
+#define log_oom() ({ \
+ log_error("Out of memory."); \
+ -ENOMEM; \
+})
/* This modifies the buffer passed! */
#define log_dump(level, buffer) log_dump_internal(level, __FILE__, __LINE__, __func__, buffer)