From 1e6a472978fa7d1040170b3e13200ad39571befe Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Wed, 24 Dec 2014 13:37:44 +0100 Subject: show truncation in outstanding worker messages --- src/master.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/master.c b/src/master.c index b14acbe..e8caca9 100644 --- a/src/master.c +++ b/src/master.c @@ -462,16 +462,18 @@ void master_output_outstanding_messages( const char *name, char *s, size_t len ) execution_worker_data_t *wed = (execution_worker_data_t *)w->execution_data; if( wed->spool_file == NULL ) return; + + char *cur = s; + char *end = s + len; long end_pos = ftell( wed->spool_file ); if( len < end_pos - wed->read_pos + 3 ) { wed->read_pos = end_pos - len + 3; + cur += snprintf( cur, end - cur, "..\n" ); } fseek( wed->spool_file, wed->read_pos, SEEK_SET ); char line[1024]; - char *cur = s; - char *end = s + len; while( wed->read_pos < end_pos ) { fgets( line, sizeof( line ), wed->spool_file ); cur += snprintf( cur, end - cur, "%s", line ); -- cgit v1.2.3-54-g00ecf