File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -286,6 +286,7 @@ xx*/ REBINT Wait_Device(REBREQ *req, REBCNT timeout)
286
286
*/ void Sieve_Ports (REBSER * ports )
287
287
/*
288
288
** Remove all ports not found in the WAKE list.
289
+ ** ports could be NULL, in which case the WAKE list is cleared.
289
290
**
290
291
***********************************************************************/
291
292
{
@@ -299,7 +300,7 @@ xx*/ REBINT Wait_Device(REBREQ *req, REBCNT timeout)
299
300
waked = VAL_BLK_SKIP (port , STD_PORT_DATA );
300
301
if (!IS_BLOCK (waked )) return ;
301
302
302
- for (n = 0 ; n < SERIES_TAIL (ports );) {
303
+ for (n = 0 ; ports && n < SERIES_TAIL (ports );) {
303
304
val = BLK_SKIP (ports , n );
304
305
if (IS_PORT (val )) {
305
306
ASSERT (VAL_TAIL (waked ) != 0 , RP_IO_ERROR );
Original file line number Diff line number Diff line change @@ -371,7 +371,10 @@ static REBSER *Read_All_File(char *fname)
371
371
if (ports ) Set_Block (D_RET , ports );
372
372
373
373
// Process port events [stack-move]:
374
- if (!Wait_Ports (ports , timeout )) return R_NONE ;
374
+ if (!Wait_Ports (ports , timeout )) {
375
+ Sieve_Ports (NULL ); /* just reset the waked list */
376
+ return R_NONE ;
377
+ }
375
378
if (!ports ) return R_NONE ;
376
379
DS_RELOAD (ds );
377
380
You can’t perform that action at this time.
0 commit comments