Merging upstream version 0.9~rc2.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
5a7d30d9fd
commit
634a6bfc0f
21 changed files with 133 additions and 71 deletions
18
zgrep.cc
18
zgrep.cc
|
@ -84,9 +84,12 @@ int zgrep_stdin( int infd, const std::vector< const char * > & grep_args )
|
|||
// parent
|
||||
if( grep_pid < 0 )
|
||||
{ show_fork_error( GREP ); return 2; }
|
||||
int retval = 0;
|
||||
if( pid && wait_for_child( pid, "data feeder" ) != 0 ) retval = 2;
|
||||
if( wait_for_child( grep_pid, GREP ) != 0 ) retval = 2;
|
||||
|
||||
int retval = wait_for_child( grep_pid, GREP );
|
||||
if( retval != 1 )
|
||||
{ if( pid ) kill( pid, SIGTERM ); }
|
||||
else
|
||||
if( pid && wait_for_child( pid, "data feeder" ) != 0 ) retval = 2;
|
||||
if( close( infd ) != 0 )
|
||||
{ show_close_error( "data feeder" ); return 2; }
|
||||
return retval;
|
||||
|
@ -146,9 +149,12 @@ int zgrep_file( int infd, const std::string & input_filename,
|
|||
}
|
||||
if( size < buffer_size ) break;
|
||||
}
|
||||
int retval = 0;
|
||||
if( pid && wait_for_child( pid, "data feeder" ) != 0 ) retval = 2;
|
||||
if( wait_for_child( grep_pid, GREP ) != 0 ) retval = 2;
|
||||
|
||||
int retval = wait_for_child( grep_pid, GREP );
|
||||
if( retval != 1 )
|
||||
{ if( pid ) kill( pid, SIGTERM ); }
|
||||
else
|
||||
if( pid && wait_for_child( pid, "data feeder" ) != 0 ) retval = 2;
|
||||
if( grep_list && retval == 0 )
|
||||
std::printf( "%s\n", input_filename.c_str() );
|
||||
if( close( infd ) != 0 )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue