From 74f3e49ba198016d7d078fbaf4954323f2cb3a15 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 4 Jan 2019 12:13:03 +0100 Subject: Merging upstream version 1.8. Signed-off-by: Daniel Baumann --- zutils.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'zutils.cc') diff --git a/zutils.cc b/zutils.cc index 2b11532..74b7351 100644 --- a/zutils.cc +++ b/zutils.cc @@ -1,5 +1,5 @@ /* Zutils - Utilities dealing with compressed files - Copyright (C) 2009-2018 Antonio Diaz Diaz. + Copyright (C) 2009-2019 Antonio Diaz Diaz. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -143,16 +143,17 @@ bool good_status( const Children & children, const bool finished ) const pid_t pid = children.pid[i]; if( pid ) { - const char * const msg = + const char * const name = ( i & 1 ) ? children.compressor_name : "data feeder"; if( !finished ) { - const int tmp = child_status( pid, msg ); - if( tmp < 0 ) kill( pid, SIGTERM ); // child not terminated + const int tmp = child_status( pid, name ); + if( tmp < 0 ) // child not terminated + { kill( pid, SIGTERM ); wait_for_child( pid, name ); } else if( tmp != 0 ) error = true; // child status != 0 } else - if( wait_for_child( pid, msg ) != 0 ) error = true; + if( wait_for_child( pid, name ) != 0 ) error = true; } } return !error; -- cgit v1.2.3