File tree 3 files changed +11
-29
lines changed
3 files changed +11
-29
lines changed Original file line number Diff line number Diff line change @@ -630,12 +630,9 @@ VALUE read_recv_each_begin(VALUE arg) {
630
630
int more = false;
631
631
struct um_op_result * result = & ctx -> op -> result ;
632
632
while (result ) {
633
- more = (result -> flags & IORING_CQE_F_MORE );
634
- if (result -> res < 0 ) {
635
- um_op_multishot_results_clear (ctx -> machine , ctx -> op );
636
- return Qnil ;
637
- }
633
+ um_raise_on_error_result (result -> res );
638
634
635
+ more = (result -> flags & IORING_CQE_F_MORE );
639
636
if (!read_recv_each_multishot_process_result (ctx , result , & total ))
640
637
return Qnil ;
641
638
Original file line number Diff line number Diff line change @@ -377,6 +377,15 @@ def test_read_each_break
377
377
ensure
378
378
t &.kill
379
379
end
380
+
381
+ def test_read_each_bad_file
382
+ r , w = IO . pipe
383
+ bgid = machine . setup_buffer_ring ( 4096 , 1024 )
384
+
385
+ assert_raises ( Errno ::EBADF ) do
386
+ machine . read_each ( w . fileno , bgid )
387
+ end
388
+ end
380
389
end
381
390
382
391
class WriteTest < UMBaseTest
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments