File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -61,18 +61,19 @@ while ($pipes || $writePipes) {
61
61
foreach ($ r as $ pipe ) {
62
62
$ type = array_search ($ pipe , $ pipes );
63
63
$ data = fread ($ pipe , 8192 );
64
- if (false === $ data || feof ($ pipe )) {
64
+ if (feof ($ pipe )) {
65
65
fclose ($ pipe );
66
66
unset($ pipes [$ type ]);
67
+ } elseif (false === $ data ) {
68
+ die ('Failed to read from pipe ' );
67
69
} else {
68
- $ resourceId = get_resource_id ($ pipe );
69
- $ procOutput [$ resourceId ] = ($ procOutput [$ resourceId ] ?? '' ) . $ data ;
70
+ $ procOutput [$ type ] = ($ procOutput [$ type ] ?? '' ) . $ data ;
70
71
}
71
72
}
72
73
}
73
74
foreach ($ procOutput as $ output ) {
74
75
if ($ output !== $ stdin ) {
75
- die ('Output does not match input ' );
76
+ die ('Output does not match input: ' . $ output );
76
77
}
77
78
}
78
79
echo "OK. " ;
You can’t perform that action at this time.
0 commit comments