Skip to content

Commit

Permalink
Scripts: capture_warnings.sh fix
Browse files Browse the repository at this point in the history
  • Loading branch information
midenok committed May 5, 2017
1 parent 53d9e61 commit 9a7a9ae
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions BUILD/capture_warnings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ warn_file="$warn_path/compile.warnings"
suppress_file="$warn_path/suppress.warnings"

exec 3>&1
cmderr=$("$@" 2>&1 1>&3)
error=$?
cmderr=$("$@" 2>&1 1>&3) || {
error=$?
echo "$cmderr" >&2
exit $error
}

if [[ -n "$cmderr" ]]; then
[[ "$warn_mode" != "late" ]] &&
Expand All @@ -17,4 +20,5 @@ if [[ -n "$cmderr" ]]; then
echo -n "$cmderr" >> "$warn_file"
fi

exit ${error}
true

0 comments on commit 9a7a9ae

Please sign in to comment.