summaryrefslogtreecommitdiffstats
path: root/zutils.cc
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-08 04:19:42 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-08 04:19:42 +0000
commit511feb57cfea29b1f6ba303cedd1456f5cecd69e (patch)
treed2aaf1e03feec10c28a6e5d156213b3eb76613ea /zutils.cc
parentAdding debian version 0.9~rc1-1. (diff)
downloadzutils-511feb57cfea29b1f6ba303cedd1456f5cecd69e.tar.xz
zutils-511feb57cfea29b1f6ba303cedd1456f5cecd69e.zip
Merging upstream version 0.9~rc2.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'zutils.cc')
-rw-r--r--zutils.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/zutils.cc b/zutils.cc
index 01a0152..7b86c7d 100644
--- a/zutils.cc
+++ b/zutils.cc
@@ -305,7 +305,8 @@ bool test_format( const int infd, std::string & file_type,
}
-int wait_for_child( const pid_t pid, const char * const name )
+int wait_for_child( const pid_t pid, const char * const name,
+ const int eretval )
{
int status;
while( waitpid( pid, &status, 0 ) == -1 )
@@ -315,10 +316,10 @@ int wait_for_child( const pid_t pid, const char * const name )
if( verbosity >= 0 )
std::fprintf( stderr, "%s: Error waiting termination of `%s': %s.\n",
util_name, name, std::strerror( errno ) );
- _exit( 1 );
+ _exit( eretval );
}
}
if( WIFEXITED( status ) ) return WEXITSTATUS( status );
- else return 1;
+ return eretval;
}