Deleted Added
full compact
34c34
< * $Id: tty_pty.c,v 1.20 1995/09/08 11:08:38 bde Exp $
---
> * $Id: tty_pty.c,v 1.21 1995/09/19 12:26:47 bde Exp $
54a55,58
> void ptyattach __P((int n));
> void ptsstart __P((struct tty *tp));
> void ptcwakeup __P((struct tty *tp, int flag));
>
489c493,494
< while (uio->uio_resid > 0 && tp->t_canq.c_cc < TTYHOG - 1) {
---
> while ((uio->uio_resid > 0 || cc > 0) &&
> tp->t_canq.c_cc < TTYHOG - 1) {
498c503,505
< if ((tp->t_state&TS_ISOPEN) == 0)
---
> if ((tp->t_state & TS_ISOPEN) == 0) {
> /* adjust as usual */
> uio->uio_resid += cc;
499a507
> }
502,503c510
< (void) b_to_q((char *)cp, cc, &tp->t_canq);
< cc = 0;
---
> cc -= b_to_q((char *)cp, cc, &tp->t_canq);
504a512,513
> /* adjust for data copied in but not written */
> uio->uio_resid += cc;
510c519
< while (uio->uio_resid > 0) {
---
> while (uio->uio_resid > 0 || cc > 0) {
518c527,529
< if ((tp->t_state&TS_ISOPEN) == 0)
---
> if ((tp->t_state & TS_ISOPEN) == 0) {
> /* adjust for data copied in but not written */
> uio->uio_resid += cc;
519a531
> }
539c551,553
< if ((tp->t_state & TS_CONNECTED) == 0)
---
> if ((tp->t_state & TS_CONNECTED) == 0) {
> /* adjust for data copied in but not written */
> uio->uio_resid += cc;
540a555
> }