[CRIU] [PATCH 4/5] log: Introduce print_on_level_perr helper

Cyrill Gorcunov gorcunov at openvz.org
Sat Jan 12 08:06:16 EST 2013


It does a simple thing -- counts trailing \Space|\Newline
symbols and inject error description right before it.

For example the caller might use it as

 | print_on_level_perr(LOG_MSG, "Error at %d\n", __LINE__);

and get output as

 | Error at 64: Cannot allocate memory

the difference from existing pr_perror helper we use
now is that it doesn't add trailing \Newline.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 include/log.h |  2 ++
 log.c         | 28 ++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-log-Introduce-print_on_level_perr-helper.patch
Type: text/x-patch
Size: 1272 bytes
Desc: not available
URL: <http://lists.openvz.org/pipermail/criu/attachments/20130112/cedbb13c/attachment.bin>


More information about the CRIU mailing list