diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-01-04 11:12:59 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-01-04 11:12:59 +0000 |
commit | d53f7b23a9ef0e79d81533ffe8b6954f2082cd54 (patch) | |
tree | 8d21a907087924ea5ab807715359cc80b4f38251 /zutils.cc | |
parent | Adding upstream version 1.7. (diff) | |
download | zutils-d53f7b23a9ef0e79d81533ffe8b6954f2082cd54.tar.xz zutils-d53f7b23a9ef0e79d81533ffe8b6954f2082cd54.zip |
Adding upstream version 1.8.upstream/1.8
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'zutils.cc')
-rw-r--r-- | zutils.cc | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -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; |