From 7a4de6aba43b720a121d83f7a54cc61e2adc1642 Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 21 Jul 2010 18:48:01 +0000 Subject: [PATCH] ptm needs no read/write, just use enodev. ok deraadt --- sys/kern/tty_pty.c | 24 +----------------------- sys/sys/conf.h | 8 ++++---- 2 files changed, 5 insertions(+), 27 deletions(-) diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c index cbc7f32fed8..810ddff7070 100644 --- a/sys/kern/tty_pty.c +++ b/sys/kern/tty_pty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty_pty.c,v 1.48 2010/07/02 19:57:15 tedu Exp $ */ +/* $OpenBSD: tty_pty.c,v 1.49 2010/07/21 18:48:01 nicm Exp $ */ /* $NetBSD: tty_pty.c,v 1.33.4.1 1996/06/02 09:08:11 mrg Exp $ */ /* @@ -118,11 +118,7 @@ dev_t pty_getfree(void); void ptmattach(int); int ptmopen(dev_t, int, int, struct proc *); int ptmclose(dev_t, int, int, struct proc *); -int ptmread(dev_t, struct uio *, int); -int ptmwrite(dev_t, struct uio *, int); -int ptmwrite(dev_t, struct uio *, int); int ptmioctl(dev_t, u_long, caddr_t, int, struct proc *p); -int ptmpoll(dev_t, int, struct proc *p); static int ptm_vn_open(struct nameidata *); void @@ -1078,18 +1074,6 @@ ptmclose(dev_t dev, int flag, int mode, struct proc *p) return (0); } -int -ptmread(dev_t dev, struct uio *uio, int ioflag) -{ - return (EIO); -} - -int -ptmwrite(dev_t dev, struct uio *uio, int ioflag) -{ - return (EIO); -} - int ptmioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) { @@ -1222,9 +1206,3 @@ bad: fdpunlock(fdp); return (error); } - -int -ptmpoll(dev_t dev, int events, struct proc *p) -{ - return (seltrue(dev, events, p)); -} diff --git a/sys/sys/conf.h b/sys/sys/conf.h index 9afdfd250e9..95fae3f1355 100644 --- a/sys/sys/conf.h +++ b/sys/sys/conf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.h,v 1.103 2010/07/21 18:43:59 deraadt Exp $ */ +/* $OpenBSD: conf.h,v 1.104 2010/07/21 18:48:01 nicm Exp $ */ /* $NetBSD: conf.h,v 1.33 1996/05/03 20:03:32 christos Exp $ */ /*- @@ -266,9 +266,9 @@ extern struct cdevsw cdevsw[]; /* open, close, read, write, ioctl, mmap */ #define cdev_ptm_init(c,n) { \ - dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \ - dev_init(c,n,write), dev_init(c,n,ioctl), (dev_type_stop((*))) enodev, \ - 0, selfalse, (dev_type_mmap((*))) enodev } + dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) enodev, \ + (dev_type_write((*))) enodev, dev_init(c,n,ioctl), \ + (dev_type_stop((*))) enodev, 0, selfalse, (dev_type_mmap((*))) enodev } /* open, close, read, ioctl, poll, kqfilter XXX should be a generic device */ #define cdev_log_init(c,n) { \ -- 2.20.1