File tree 1 file changed +10
-6
lines changed
1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -451,6 +451,16 @@ static void ttypxy_run(struct ttypxy *ctx)
451
451
if (n <= 0 )
452
452
break ;
453
453
454
+ for (i = 0 ; i < ctx -> frontdev_cnt ; i ++ ) {
455
+ if (!ctx -> frontdevs [i ].td_active )
456
+ continue ;
457
+
458
+ if (xwrite (ctx -> frontdevs [i ].td_fd , buffer , n ) != n )
459
+ warn ("write(%s) front TTY failed: %s\n" ,
460
+ ctx -> frontdevs [i ].td_pts_link ,
461
+ strerror (errno ));
462
+ }
463
+
454
464
if (verbose )
455
465
hexdump (ctx -> backdev .td_path , buffer , n );
456
466
}
@@ -459,12 +469,6 @@ static void ttypxy_run(struct ttypxy *ctx)
459
469
if (!ctx -> frontdevs [i ].td_active )
460
470
continue ;
461
471
462
- if (n > 0 )
463
- if (xwrite (ctx -> frontdevs [i ].td_fd , buffer , n ) != n )
464
- warn ("write(%s) front TTY failed: %s\n" ,
465
- ctx -> frontdevs [i ].td_pts_link ,
466
- strerror (errno ));
467
-
468
472
if (FD_ISSET (ctx -> frontdevs [i ].td_fd , & rfds )) {
469
473
n = xread (ctx -> frontdevs [i ].td_fd , buffer , sizeof (buffer ));
470
474
if (n <= 0 ) {
You can’t perform that action at this time.
0 commit comments