@@ -177,8 +177,8 @@ sub _start {
177
177
my $pid ;
178
178
179
179
if ($args -> {conduit } eq ' pipe' ) {
180
- pipe $stdout_read , $stdout_write or return $self -> emit_safe (error => " pipe: $! " );
181
- pipe $stdin_read , $stdin_write or return $self -> emit_safe (error => " pipe: $! " );
180
+ pipe $stdout_read , $stdout_write or return $self -> emit (error => " pipe: $! " );
181
+ pipe $stdin_read , $stdin_write or return $self -> emit (error => " pipe: $! " );
182
182
select +(select ($stdout_write ), $| = 1)[0];
183
183
select +(select ($stdin_write ), $| = 1)[0];
184
184
}
@@ -187,14 +187,14 @@ sub _start {
187
187
}
188
188
else {
189
189
warn " Invalid conduit ($args ->{conduit})\n " if DEBUG;
190
- return $self -> emit_safe (error => " Invalid conduit ($args ->{conduit})" );
190
+ return $self -> emit (error => " Invalid conduit ($args ->{conduit})" );
191
191
}
192
192
193
193
$pid = fork ;
194
194
195
195
if (!defined $pid ) {
196
196
warn " Could not fork $! \n " if DEBUG;
197
- $self -> emit_safe (error => " Couldn't fork ($! )" );
197
+ $self -> emit (error => " Couldn't fork ($! )" );
198
198
}
199
199
elsif ($pid ) { # parent ===================================================
200
200
warn " [$pid ] Child starting ($args ->{program} @{$args ->{program_args}})\n " if DEBUG;
@@ -219,7 +219,7 @@ sub _start {
219
219
}
220
220
elsif ($self -> {errno }) {
221
221
warn " [$pid ] Child $self ->{errno}\n " if DEBUG;
222
- $self -> emit_safe (error => " Read error: $self ->{errno}" );
222
+ $self -> emit (error => " Read error: $self ->{errno}" );
223
223
}
224
224
});
225
225
$self -> reactor-> watch($stdout_read , 1, 0);
@@ -279,7 +279,7 @@ sub _setup_recurring_child_alive_check {
279
279
warn " [$pid ] Child is dead $exit_value /$signal \n " if DEBUG;
280
280
delete $reactor -> {forks }{$pid } or next ; # SUPER DUPER IMPORTANT THAT THIS next; IS NOT BEFORE waitpid; ABOVE!
281
281
$obj -> _read; # flush the rest
282
- $obj -> emit_safe (close => $exit_value , $signal );
282
+ $obj -> emit (close => $exit_value , $signal );
283
283
$obj -> _cleanup;
284
284
}
285
285
});
@@ -354,7 +354,7 @@ sub _read {
354
354
return unless defined $read ;
355
355
return unless $read ;
356
356
warn " [$self ->{pid}] Got buffer (" .url_escape($buffer ) ." )\n " if DEBUG;
357
- $self -> emit_safe (read => $buffer );
357
+ $self -> emit (read => $buffer );
358
358
}
359
359
360
360
sub _write {
@@ -373,7 +373,7 @@ sub _write {
373
373
$self -> reactor-> timer(0.01 => sub { $self and $self -> _write });
374
374
}
375
375
else {
376
- $self -> emit_safe (' drain' );
376
+ $self -> emit (' drain' );
377
377
}
378
378
}
379
379
0 commit comments