From 8eee52009825a5897aecf8b1b18f79d1100fce21 Mon Sep 17 00:00:00 2001 From: Ari Jolma Date: Sun, 12 Nov 2023 18:21:56 +0200 Subject: [PATCH] VSIStdoutSetRedirection: return what the write method returns or 1 as that indicates success for GDAL --- lib/Geo/GDAL/FFI.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Geo/GDAL/FFI.pm b/lib/Geo/GDAL/FFI.pm index 1a6ea0f..55bb80e 100644 --- a/lib/Geo/GDAL/FFI.pm +++ b/lib/Geo/GDAL/FFI.pm @@ -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); }