From: derek Date: Mon, 6 Dec 2010 21:30:13 +0000 (-0500) Subject: Fixed : improper exit code from FilterTool X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=d9088d1c37ada9d748ac5ee8cefc2e773621566e;p=bamtools.git Fixed : improper exit code from FilterTool --- diff --git a/src/toolkit/bamtools_filter.cpp b/src/toolkit/bamtools_filter.cpp index b57cf05..2b8b45e 100644 --- a/src/toolkit/bamtools_filter.cpp +++ b/src/toolkit/bamtools_filter.cpp @@ -736,7 +736,7 @@ bool FilterTool::FilterToolPrivate::Run(void) { // initialize defined properties & user-specified filters // quit if failed - if ( !SetupFilters() ) return 1; + if ( !SetupFilters() ) return false; // open reader without index BamMultiReader reader; @@ -779,7 +779,7 @@ bool FilterTool::FilterToolPrivate::Run(void) { // if error if ( !openedOK ) { cerr << "ERROR: Could not open input BAM file(s)... Aborting." << endl; - return 1; + return false; } // if index data available, we can use SetRegion @@ -789,7 +789,7 @@ bool FilterTool::FilterToolPrivate::Run(void) { if ( !reader.SetRegion(region.LeftRefID, region.LeftPosition, region.RightRefID, region.RightPosition) ) { cerr << "ERROR: Region requested, but could not set BamReader region to REGION: " << m_settings->Region << " Aborting." << endl; reader.Close(); - return 1; + return false; } // everything checks out, just iterate through specified region, filtering alignments @@ -817,14 +817,14 @@ bool FilterTool::FilterToolPrivate::Run(void) { cerr << "ERROR: Could not parse REGION - " << m_settings->Region << endl; cerr << "Be sure REGION is in valid format (see README) and that coordinates are valid for selected references" << endl; reader.Close(); - return 1; + return false; } } // clean up & exit reader.Close(); writer.Close(); - return 0; + return true; } bool FilterTool::FilterToolPrivate::SetupFilters(void) {