Skip to content

Commit

Permalink
VSIStdoutSetRedirection: return what the write method returns or 1 as…
Browse files Browse the repository at this point in the history
… that indicates success for GDAL
  • Loading branch information
Ari Jolma committed Nov 12, 2023
1 parent 18bfef5 commit 8eee520
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Geo/GDAL/FFI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1725,7 +1725,8 @@ sub SetWriter {
$self->{close} = $c;
$self->{writer} = $self->{ffi}->closure(sub {
my ($buf, $size, $count, $stream) = @_;
$w->(buffer_to_scalar($buf, $size*$count));
my $retval = $w->(buffer_to_scalar($buf, $size*$count)) // 1;
return $retval;
});
VSIStdoutSetRedirection($self->{writer}, 0);
}
Expand Down

0 comments on commit 8eee520

Please sign in to comment.