summaryrefslogtreecommitdiff
path: root/src/shared/log.h
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2012-07-26 14:23:49 +0200
committerMichal Schmidt <mschmidt@redhat.com>2012-07-26 14:24:40 +0200
commit6dc1e7e0ba35c078b533d06a4933edae38fd94ad (patch)
tree708b9c05aeb64cddb4c2febe15309cb8a3892853 /src/shared/log.h
parentcd6f1c0f87fd3e3345e51476e25cd1104efb7fa3 (diff)
log: out-of-line __log_oom()
The callers' code gets smaller.
Diffstat (limited to 'src/shared/log.h')
-rw-r--r--src/shared/log.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/shared/log.h b/src/shared/log.h
index 7c3376c31e..ab894df172 100644
--- a/src/shared/log.h
+++ b/src/shared/log.h
@@ -103,11 +103,8 @@ 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__)
-/* This must be a macro for __LINE__ etc. to work */
-#define log_oom() ({ \
- log_error("Out of memory."); \
- -ENOMEM; \
-})
+int __log_oom(const char *file, int line, const char *func);
+#define log_oom() __log_oom(__FILE__, __LINE__, __func__)
/* This modifies the buffer passed! */
#define log_dump(level, buffer) log_dump_internal(level, __FILE__, __LINE__, __func__, buffer)