X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fshared%2Flog.h;h=7bdb3e08650bf6dc27a0a348c1d7a28cf820fe2a;hp=c986b2579d7cff2f837286983cc7cadfb682ca26;hb=0d0f0c50d3a1d90f03972a6abb82e6413daaa583;hpb=e146e4516b9ea9907852e7ad609de39dca9e8769 diff --git a/src/shared/log.h b/src/shared/log.h index c986b2579..7bdb3e086 100644 --- a/src/shared/log.h +++ b/src/shared/log.h @@ -24,6 +24,7 @@ #include #include #include +#include #include "macro.h" @@ -102,6 +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 modifies the buffer passed! */ #define log_dump(level, buffer) log_dump_internal(level, __FILE__, __LINE__, __func__, buffer)