mirror of
https://git.savannah.gnu.org/git/parallel.git
synced 2024-11-22 05:57:54 +00:00
parallel: Fixed: bug #42329: --line-buffer gives wrong output
This commit is contained in:
parent
4b4266c466
commit
7a018602da
|
@ -214,9 +214,9 @@ cc:Tim Cuthbertson <tim3d.junk@gmail.com>,
|
|||
Ryoichiro Suzuki <ryoichiro.suzuki@gmail.com>,
|
||||
Jesse Alama <jesse.alama@gmail.com>
|
||||
|
||||
Subject: GNU Parallel 20140522 ('Nej') released
|
||||
Subject: GNU Parallel 20140522 ('Boko Haram') released
|
||||
|
||||
GNU Parallel 20140522 ('Nej') has been released. It is available for download at: http://ftp.gnu.org/gnu/parallel/
|
||||
GNU Parallel 20140522 ('Boko Haram') has been released. It is available for download at: http://ftp.gnu.org/gnu/parallel/
|
||||
|
||||
|
||||
New in this release:
|
||||
|
@ -227,8 +227,12 @@ New in this release:
|
|||
|
||||
* BioLite uses GNU Parallel: https://bitbucket.org/caseywdunn/biolite
|
||||
|
||||
* Isitdown uses GNU Parallel: http://www.isi.edu/~calvin/isitdown.md
|
||||
|
||||
* Convert FLAC to MP3 with GNU parallel http://www.blogobramje.nl/posts/Convert_FLAC_to_MP3_with_GNU_parallel/
|
||||
|
||||
* No:The-Me GNU Parallel http://adityalaghate.in/gnu-parallel.html
|
||||
|
||||
* Bug fixes and man page updates.
|
||||
|
||||
GNU Parallel - For people who live life in the parallel lane.
|
||||
|
|
17
src/parallel
17
src/parallel
|
@ -4388,12 +4388,13 @@ sub openoutputfiles {
|
|||
} else {
|
||||
# Set reading FD
|
||||
for my $fdno (1,2) {
|
||||
my $fdw = $self->fh($fdno,'w');
|
||||
# Duplicate filehandle, so fdw can be closed seperately
|
||||
open(my $fdr,"<&",$fdw) || die;
|
||||
# Re-open the file for reading
|
||||
# so fdw can be closed seperately
|
||||
# and fdr can be seeked seperately (for --line-buffer)
|
||||
open(my $fdr,"<", $self->fh($fdno,'name')) || die;
|
||||
$self->set_fh($fdno,'r',$fdr);
|
||||
# Unlink if required
|
||||
unlink $self->fh($fdno,"unlink");
|
||||
$Global::debug or unlink $self->fh($fdno,"unlink");
|
||||
}
|
||||
}
|
||||
if($opt::linebuffer) {
|
||||
|
@ -5240,7 +5241,13 @@ sub print {
|
|||
# This seek will clear EOF
|
||||
seek $in_fh, tell($in_fh), 0;
|
||||
# The read is non-blocking: The $in_fh is set to non-blocking.
|
||||
while(read($in_fh,substr($$partial,length $$partial),1_000_000)) {
|
||||
# 32768 --tag = 5.1s
|
||||
# 327680 --tag = 4.4s
|
||||
# 1024000 --tag = 4.4s
|
||||
# 3276800 --tag = 4.3s
|
||||
# 32768000 --tag = 4.7s
|
||||
# 10240000 --tag = 4.3s
|
||||
while(read($in_fh,substr($$partial,length $$partial),3276800)) {
|
||||
# Append to $$partial
|
||||
# Find the last \n
|
||||
my $i = rindex($$partial,"\n");
|
||||
|
|
|
@ -4,6 +4,10 @@ rm -rf tmp 2>/dev/null
|
|||
cp -a input-files/testdir2 tmp
|
||||
|
||||
cat <<'EOF' | sed -e 's/;$/; /;s/$SERVER1/'$SERVER1'/;s/$SERVER2/'$SERVER2'/' | stdout parallel -j0 -k -L1
|
||||
echo '### bug #42329: --line-buffer gives wrong output';
|
||||
parallel --line-buffer --tag seq ::: 10000000 | wc -c;
|
||||
parallel --line-buffer seq ::: 10000000 | wc -c
|
||||
|
||||
echo '### Test \0 as recend';
|
||||
printf "a\0b\0c\0" | parallel --recend '\0' -k -N1 --pipe cat -v \; echo;
|
||||
printf "\0a\0b\0c" | parallel --recstart '\0' -k -N1 --pipe cat -v \; echo
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
### bug #42329: --line-buffer gives wrong output
|
||||
168888897
|
||||
78888897
|
||||
### Test \0 as recend
|
||||
a^@
|
||||
b^@
|
||||
|
|
Loading…
Reference in a new issue