From cc4419ed929b5c7c99eaed020b015b1b2e8c7a66 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Sat, 25 Feb 2017 17:29:14 -0500 Subject: coredumpctl,man: mark truncated messages as such in output Unit systemd-coredump@1-3854-0.service is failed/failed, not counting it. TIME PID UID GID SIG COREFILE EXE Fri 2017-02-24 11:11:00 EST 10002 1000 1000 6 none /home/zbyszek/src/systemd-work/.libs/lt-Sat 2017-02-25 00:49:32 EST 26921 0 0 11 error /usr/libexec/fprintd Sat 2017-02-25 11:56:30 EST 30703 1000 1000 - - /usr/bin/python3.5 Sat 2017-02-25 13:16:54 EST 3275 1000 1000 11 present /usr/bin/bash Sat 2017-02-25 17:25:40 EST 4049 1000 1000 11 truncated /usr/bin/bash For info and gdb output, the filename is marked in red and "(truncated)" is appended. (Red is necessary because the annotation is hard to see when running under a pager.) Fixed #3883. --- src/coredump/coredump.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/coredump/coredump.c') diff --git a/src/coredump/coredump.c b/src/coredump/coredump.c index 855f0e9330..9e7206cc6a 100644 --- a/src/coredump/coredump.c +++ b/src/coredump/coredump.c @@ -325,7 +325,7 @@ static int save_external_coredump( int *ret_node_fd, int *ret_data_fd, uint64_t *ret_size, - bool *truncated) { + bool *ret_truncated) { _cleanup_free_ char *fn = NULL, *tmp = NULL; _cleanup_close_ int fd = -1; @@ -374,8 +374,8 @@ static int save_external_coredump( log_error_errno(r, "Cannot store coredump of %s (%s): %m", context[CONTEXT_PID], context[CONTEXT_COMM]); goto fail; } - *truncated = r == 1; - if (*truncated) + *ret_truncated = r == 1; + if (*ret_truncated) log_struct(LOG_INFO, LOG_MESSAGE("Core file was truncated to %zu bytes.", max_size), "SIZE_LIMIT=%zu", max_size, -- cgit v1.2.3-54-g00ecf