Deleted Added
full compact
pty.c (6782) pty.c (7724)
1/*
2 * Copyright (c) 1982, 1986, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)tty_pty.c 8.2 (Berkeley) 9/23/93
1/*
2 * Copyright (c) 1982, 1986, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)tty_pty.c 8.2 (Berkeley) 9/23/93
34 * $Id: tty_pty.c,v 1.7 1995/02/25 20:09:30 pst Exp $
34 * $Id: tty_pty.c,v 1.8 1995/02/28 00:21:05 pst Exp $
35 */
36
37/*
38 * Pseudo-teletype Driver
39 * (Actually two drivers, requiring two entries in 'cdevsw')
40 */
41#include "pty.h" /* XXX */
42

--- 96 unchanged lines hidden (view full) ---

139 if (flag&FNONBLOCK)
140 break;
141 error = ttysleep(tp, (caddr_t)&tp->t_rawq, TTIPRI | PCATCH,
142 ttopen, 0);
143 if (error)
144 return (error);
145 }
146 error = (*linesw[tp->t_line].l_open)(dev, tp);
35 */
36
37/*
38 * Pseudo-teletype Driver
39 * (Actually two drivers, requiring two entries in 'cdevsw')
40 */
41#include "pty.h" /* XXX */
42

--- 96 unchanged lines hidden (view full) ---

139 if (flag&FNONBLOCK)
140 break;
141 error = ttysleep(tp, (caddr_t)&tp->t_rawq, TTIPRI | PCATCH,
142 ttopen, 0);
143 if (error)
144 return (error);
145 }
146 error = (*linesw[tp->t_line].l_open)(dev, tp);
147 ptcwakeup(tp, FREAD|FWRITE);
147 if (error == 0)
148 ptcwakeup(tp, FREAD|FWRITE);
148 return (error);
149}
150
151int
152ptsclose(dev, flag, mode, p)
153 dev_t dev;
154 int flag, mode;
155 struct proc *p;
156{
157 register struct tty *tp;
158 int err;
159
160 tp = &pt_tty[minor(dev)];
149 return (error);
150}
151
152int
153ptsclose(dev, flag, mode, p)
154 dev_t dev;
155 int flag, mode;
156 struct proc *p;
157{
158 register struct tty *tp;
159 int err;
160
161 tp = &pt_tty[minor(dev)];
161 err = (*linesw[tp->t_line].l_close)(tp, flag);
162 err |= ttyclose(tp);
163 ptcwakeup(tp, FREAD|FWRITE);
162 ptcwakeup(tp, FREAD|FWRITE);
163 err = (*linesw[tp->t_line].l_close)(tp, flag);
164 (void) ttyclose(tp);
164 return (err);
165}
166
167int
168ptsread(dev, uio, flag)
169 dev_t dev;
170 struct uio *uio;
171 int flag;

--- 550 unchanged lines hidden ---
165 return (err);
166}
167
168int
169ptsread(dev, uio, flag)
170 dev_t dev;
171 struct uio *uio;
172 int flag;

--- 550 unchanged lines hidden ---