summaryrefslogtreecommitdiffstats
path: root/zutils.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-01-04 11:13:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-01-04 11:13:03 +0000
commit74f3e49ba198016d7d078fbaf4954323f2cb3a15 (patch)
tree3be3ee4bf92eb1d9c3576e6019aa0010015c0161 /zutils.cc
parentReleasing debian version 1.7-8. (diff)
downloadzutils-74f3e49ba198016d7d078fbaf4954323f2cb3a15.tar.xz
zutils-74f3e49ba198016d7d078fbaf4954323f2cb3a15.zip
Merging upstream version 1.8.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'zutils.cc')
-rw-r--r--zutils.cc11
1 files changed, 6 insertions, 5 deletions
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;