diff options
author | phk <phk@FreeBSD.org> | 2000-09-02 19:17:34 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2000-09-02 19:17:34 +0000 |
commit | e47f61e18396b6e5f61ee91b9f9f832976ee96cf (patch) | |
tree | bc17f23dc3fa3b9663516bac048049a5f02652ea /sys/kern/tty_pty.c | |
parent | 0ab175f21b9e105fcbe4db6569019e946f23e13c (diff) | |
download | FreeBSD-src-e47f61e18396b6e5f61ee91b9f9f832976ee96cf.zip FreeBSD-src-e47f61e18396b6e5f61ee91b9f9f832976ee96cf.tar.gz |
Avoid the modules madness I inadvertently introduced by making the
cloning infrastructure standard in kern_conf. Modules are now
the same with or without devfs support.
If you need to detect if devfs is present, in modules or elsewhere,
check the integer variable "devfs_present".
This happily removes an ugly hack from kern/vfs_conf.c.
This forces a rename of the eventhandler and the standard clone
helper function.
Include <sys/eventhandler.h> in <sys/conf.h>: it's a helper #include
like <sys/queue.h>
Remove all #includes of opt_devfs.h they no longer matter.
Diffstat (limited to 'sys/kern/tty_pty.c')
-rw-r--r-- | sys/kern/tty_pty.c | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c index d4402cd..e8e7bbe 100644 --- a/sys/kern/tty_pty.c +++ b/sys/kern/tty_pty.c @@ -39,7 +39,6 @@ * (Actually two drivers, requiring two entries in 'cdevsw') */ #include "opt_compat.h" -#include "opt_devfs.h" #include <sys/param.h> #include <sys/systm.h> #if defined(COMPAT_43) || defined(COMPAT_SUNOS) @@ -55,11 +54,6 @@ #include <sys/signalvar.h> #include <sys/malloc.h> -#ifdef DEVFS -#include <sys/eventhandler.h> -#include <fs/devfs/devfs.h> -#endif - MALLOC_DEFINE(M_PTY, "ptys", "pty data structures"); static void ptsstart __P((struct tty *tp)); @@ -177,23 +171,8 @@ ptsopen(dev, flag, devtype, p) int error; struct pt_ioctl *pti; -#ifndef DEVFS - { - int minr = lminor(dev); - /* - * If we openned this device, ensure we have the - * next one too, so people can open it. - */ - if (minr < 255) { - dev_t nextdev = makedev(major(dev), minr + 1); - if (!nextdev->si_drv1) { - ptyinit(minr + 1); - } - } if (!dev->si_drv1) ptyinit(minor(dev)); - } -#endif if (!dev->si_drv1) return(ENXIO); pti = dev->si_drv1; @@ -355,10 +334,8 @@ ptcopen(dev, flag, devtype, p) register struct tty *tp; struct pt_ioctl *pti; -#ifndef DEVFS if (!dev->si_drv1) ptyinit(minor(dev)); -#endif if (!dev->si_drv1) return(ENXIO); tp = dev->si_tty; @@ -826,7 +803,6 @@ ptyioctl(dev, cmd, data, flag, p) static void ptc_drvinit __P((void *unused)); -#ifdef DEVFS static void pty_clone __P((void *arg, char *name, int namelen, dev_t *dev)); static void @@ -865,20 +841,13 @@ pty_clone(arg, name, namelen, dev) return; } - -#endif - static void ptc_drvinit(unused) void *unused; { -#ifdef DEVFS - EVENTHANDLER_REGISTER(devfs_clone, pty_clone, 0, 1000); -#else + EVENTHANDLER_REGISTER(dev_clone, pty_clone, 0, 1000); cdevsw_add(&pts_cdevsw); cdevsw_add(&ptc_cdevsw); - ptyinit(0); -#endif } SYSINIT(ptcdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR_C,ptc_drvinit,NULL) |