chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e239cd8
)
log: log_oom() must be a macro
author
Michal Schmidt
<mschmidt@redhat.com>
Thu, 26 Jul 2012 12:07:27 +0000
(14:07 +0200)
committer
Michal Schmidt
<mschmidt@redhat.com>
Thu, 26 Jul 2012 12:07:27 +0000
(14:07 +0200)
src/shared/log.h
patch
|
blob
|
history
diff --git
a/src/shared/log.h
b/src/shared/log.h
index 7bdb3e08650bf6dc27a0a348c1d7a28cf820fe2a..7c3376c31e5efdda0ecc2eb7106294635c6a6eff 100644
(file)
--- 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__)
#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)
/* This modifies the buffer passed! */
#define log_dump(level, buffer) log_dump_internal(level, __FILE__, __LINE__, __func__, buffer)