Skip to content

Commit

Permalink
Bug #2729: Fix the race condition for stdout destinations as well as
Browse files Browse the repository at this point in the history
as file destinations
  • Loading branch information
Jaime Melis committed Apr 1, 2014
1 parent c191cee commit d44e5be
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/datastore_mad/remotes/downloader.sh
Expand Up @@ -188,10 +188,7 @@ esac
file_type=$(get_type "$command")
decompressor=$(get_decompressor "$file_type")

# Note: the 'cat' at the end of this pipeline forces the pipe to wait until
# all the 'tee' processes are finished
$command | tee >( decompress "$decompressor" "$TO" ) \
>( hasher $HASH_TYPE ) | cat >/dev/null
$command | tee >( hasher $HASH_TYPE) | decompress "$decompressor" "$TO"

if [ "$?" != "0" ]; then
echo "Error copying" >&2
Expand Down

0 comments on commit d44e5be

Please sign in to comment.