Skip to content

Commit 0adb132

Browse files
author
Jan Henning Thorsen
committed
Fix "Use of uninitialized value in numeric eq (==) at ReadWriteFork.pm line 182."
1 parent da4cc48 commit 0adb132

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Changes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
Revision history for Mojo-IOLoop-ReadWriteFork
22

3+
0.06
4+
* Fix "Use of uninitialized value in numeric eq (==) at ReadWriteFork.pm line 182."
5+
36
0.05 Wed Feb 19 13:29:54 2014
47
* Fix "read" event cannot change ERRNO from sysread()
58

lib/Mojo/IOLoop/ReadWriteFork.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ sub start {
127127
my $args = ref $_[0] ? $_[0] : {@_};
128128

129129
$args->{env} = { %ENV };
130+
$self->{errno} = 0;
130131
$args->{program} or die 'program is required input';
131132
$args->{conduit} ||= 'pipe';
132133
$args->{program_args} ||= [];
@@ -302,7 +303,7 @@ sub _read {
302303
my $stdout_read = $self->{stdout_read} or return;
303304
my $read = $stdout_read->sysread(my $buffer, CHUNK_SIZE, 0);
304305

305-
$self->{errno} = $!;
306+
$self->{errno} = $! // 0;
306307

307308
return unless defined $read;
308309
return unless $read;

0 commit comments

Comments
 (0)