diff options
| author | John-Mark Gurney <jmg@FreeBSD.org> | 1997-07-30 10:05:18 +0000 |
|---|---|---|
| committer | John-Mark Gurney <jmg@FreeBSD.org> | 1997-07-30 10:05:18 +0000 |
| commit | 5e2022633a0037a1dd6b5cee78ff6bec4013013d (patch) | |
| tree | 4c624a081bb42f7355d193fb4b8d8f084f965102 | |
| parent | f1909e979cba3f94e15edbc3e12c568c9b68ca8d (diff) | |
Notes
| -rw-r--r-- | sys/kern/tty_pty.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c index ee0b65334cc3..f721b413e976 100644 --- a/sys/kern/tty_pty.c +++ b/sys/kern/tty_pty.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tty_pty.c 8.4 (Berkeley) 2/20/95 - * $Id: tty_pty.c,v 1.42 1997/03/23 03:36:28 bde Exp $ + * $Id: tty_pty.c,v 1.43 1997/03/24 12:03:06 bde Exp $ */ /* @@ -93,6 +93,19 @@ static struct cdevsw ptc_cdevsw = #if NPTY == 1 #undef NPTY #define NPTY 32 /* crude XXX */ +#warning You have only one pty defined, redefining to 32. +#endif + +#ifdef DEVFS +#define MAXUNITS (8 * 32) +static void *devfs_token_pts[MAXUNITS]; +static void *devfs_token_ptc[MAXUNITS]; +static const char jnames[] = "pqrsPQRS"; +#if NPTY > MAXUNITS +#undef NPTY +#define NPTY MAXUNITS +#warning Can't have more than 256 pty's with DEVFS defined. +#endif #endif #define BUFSIZ 100 /* Chunk size iomoved to/from user */ @@ -710,7 +723,8 @@ ptyioctl(dev, cmd, data, flag, p) break; case TIOCSIG: - if (*(unsigned int *)data >= NSIG) + if (*(unsigned int *)data >= NSIG || + *(unsigned int *)data == 0) return(EINVAL); if ((tp->t_lflag&NOFLSH) == 0) ttyflush(tp, FREAD|FWRITE); @@ -780,12 +794,6 @@ ptyioctl(dev, cmd, data, flag, p) } static ptc_devsw_installed = 0; -#ifdef DEVFS -#define MAXUNITS (8 * 32) -static void *devfs_token_pts[MAXUNITS]; -static void *devfs_token_ptc[MAXUNITS]; -static const char jnames[] = "pqrsPQRS"; -#endif static void ptc_drvinit(void *unused) @@ -802,11 +810,6 @@ ptc_drvinit(void *unused) cdevsw_add(&dev, &ptc_cdevsw, NULL); ptc_devsw_installed = 1; #ifdef DEVFS -/*XXX*/ -#if NPTY > MAXUNITS -#undef NPTY -#define NPTY MAXUNITS -#endif for ( i = 0 ; i<NPTY ; i++ ) { j = i / 32; k = i % 32; |
