1
0
Fork 0

Merging upstream version 1.8.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-24 05:58:06 +01:00
parent 482a36ad54
commit 0b238fdfef
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
34 changed files with 858 additions and 455 deletions

View file

@ -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;