mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-14 10:09:48 +00:00
Make nokqfilter() return the correct return value.
Ditch the D_KQFILTER flag which was used to prevent calling NULL pointers.
This commit is contained in:
parent
69ea8786d6
commit
182a9f7455
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=111821
@ -113,7 +113,6 @@ static struct cdevsw targ_cdevsw = {
|
||||
.d_poll = targpoll,
|
||||
.d_name = "targ",
|
||||
.d_maj = TARG_CDEV_MAJOR,
|
||||
.d_flags = D_KQFILTER,
|
||||
.d_kqfilter = targkqfilter
|
||||
};
|
||||
|
||||
|
@ -405,7 +405,7 @@ static struct cdevsw sio_cdevsw = {
|
||||
.d_poll = ttypoll,
|
||||
.d_name = driver_name,
|
||||
.d_maj = CDEV_MAJOR,
|
||||
.d_flags = D_TTY | D_KQFILTER,
|
||||
.d_flags = D_TTY,
|
||||
.d_kqfilter = ttykqfilter,
|
||||
};
|
||||
|
||||
|
@ -405,7 +405,7 @@ static struct cdevsw sio_cdevsw = {
|
||||
.d_poll = ttypoll,
|
||||
.d_name = driver_name,
|
||||
.d_maj = CDEV_MAJOR,
|
||||
.d_flags = D_TTY | D_KQFILTER,
|
||||
.d_flags = D_TTY,
|
||||
.d_kqfilter = ttykqfilter,
|
||||
};
|
||||
|
||||
|
@ -250,7 +250,7 @@ static struct cdevsw dgb_cdevsw = {
|
||||
.d_poll = ttypoll,
|
||||
.d_name = "dgb",
|
||||
.d_maj = CDEV_MAJOR,
|
||||
.d_flags = D_TTY | D_KQFILTER,
|
||||
.d_flags = D_TTY,
|
||||
.d_kqfilter = ttykqfilter,
|
||||
};
|
||||
|
||||
|
@ -151,7 +151,7 @@ static struct cdevsw digi_sw = {
|
||||
.d_poll = ttypoll,
|
||||
.d_name = driver_name,
|
||||
.d_maj = CDEV_MAJOR,
|
||||
.d_flags = D_TTY | D_KQFILTER,
|
||||
.d_flags = D_TTY,
|
||||
.d_kqfilter = ttykqfilter
|
||||
};
|
||||
|
||||
|
@ -154,7 +154,7 @@ static struct cdevsw rc_cdevsw = {
|
||||
.d_poll = ttypoll,
|
||||
.d_name = "rc",
|
||||
.d_maj = CDEV_MAJOR,
|
||||
.d_flags = D_TTY | D_KQFILTER,
|
||||
.d_flags = D_TTY,
|
||||
.d_kqfilter = ttykqfilter,
|
||||
};
|
||||
|
||||
|
@ -168,7 +168,7 @@ static struct cdevsw sabtty_cdevsw = {
|
||||
.d_poll = ttypoll,
|
||||
.d_name = "sabtty",
|
||||
.d_maj = MAJOR_AUTO,
|
||||
.d_flags = D_TTY | D_KQFILTER,
|
||||
.d_flags = D_TTY,
|
||||
.d_kqfilter = ttykqfilter,
|
||||
};
|
||||
|
||||
|
@ -124,7 +124,7 @@ static struct cdevsw si_cdevsw = {
|
||||
.d_poll = ttypoll,
|
||||
.d_name = "si",
|
||||
.d_maj = CDEV_MAJOR,
|
||||
.d_flags = D_TTY | D_KQFILTER,
|
||||
.d_flags = D_TTY,
|
||||
.d_kqfilter = ttykqfilter,
|
||||
};
|
||||
|
||||
|
@ -322,7 +322,7 @@ static struct cdevsw sio_cdevsw = {
|
||||
.d_poll = ttypoll,
|
||||
.d_name = sio_driver_name,
|
||||
.d_maj = CDEV_MAJOR,
|
||||
.d_flags = D_TTY | D_KQFILTER,
|
||||
.d_flags = D_TTY,
|
||||
.d_kqfilter = ttykqfilter,
|
||||
};
|
||||
|
||||
|
@ -221,7 +221,7 @@ static struct cdevsw sc_cdevsw = {
|
||||
.d_mmap = scmmap,
|
||||
.d_name = "sc",
|
||||
.d_maj = CDEV_MAJOR,
|
||||
.d_flags = D_TTY | D_KQFILTER,
|
||||
.d_flags = D_TTY,
|
||||
.d_kqfilter = ttykqfilter
|
||||
};
|
||||
|
||||
|
@ -136,7 +136,7 @@ static struct cdevsw ucom_cdevsw = {
|
||||
.d_poll = ttypoll,
|
||||
.d_name = "ucom",
|
||||
.d_maj = UCOM_CDEV_MAJOR,
|
||||
.d_flags = D_TTY | D_KQFILTER,
|
||||
.d_flags = D_TTY,
|
||||
#if __FreeBSD_version < 500014
|
||||
/* bmaj */ -1,
|
||||
#endif
|
||||
|
@ -158,7 +158,7 @@ static struct cdevsw zstty_cdevsw = {
|
||||
.d_poll = ttypoll,
|
||||
.d_name = "zstty",
|
||||
.d_maj = MAJOR_AUTO,
|
||||
.d_flags = D_TTY | D_KQFILTER,
|
||||
.d_flags = D_TTY,
|
||||
.d_kqfilter = ttykqfilter,
|
||||
};
|
||||
|
||||
|
@ -392,8 +392,6 @@ spec_kqfilter(ap)
|
||||
|
||||
dev = ap->a_vp->v_rdev;
|
||||
dsw = devsw(dev);
|
||||
if (!(dsw->d_flags & D_KQFILTER))
|
||||
return (1);
|
||||
if (dsw->d_flags & D_NOGIANT) {
|
||||
DROP_GIANT();
|
||||
error = dsw->d_kqfilter(dev, ap->a_kn);
|
||||
|
@ -81,7 +81,7 @@ struct cdevsw cx_cdevsw = {
|
||||
.d_poll = ttypoll,
|
||||
.d_name = "cx",
|
||||
.d_maj = CDEV_MAJOR,
|
||||
.d_flags = D_TTY | D_KQFILTER,
|
||||
.d_flags = D_TTY,
|
||||
.d_kqfilter = ttykqfilter,
|
||||
};
|
||||
|
||||
|
@ -405,7 +405,7 @@ static struct cdevsw sio_cdevsw = {
|
||||
.d_poll = ttypoll,
|
||||
.d_name = driver_name,
|
||||
.d_maj = CDEV_MAJOR,
|
||||
.d_flags = D_TTY | D_KQFILTER,
|
||||
.d_flags = D_TTY,
|
||||
.d_kqfilter = ttykqfilter,
|
||||
};
|
||||
|
||||
|
@ -650,7 +650,7 @@ static struct cdevsw stli_cdevsw = {
|
||||
.d_poll = ttypoll,
|
||||
.d_name = stli_drvname,
|
||||
.d_maj = CDEV_MAJOR,
|
||||
.d_flags = D_TTY | D_KQFILTER,
|
||||
.d_flags = D_TTY,
|
||||
.d_kqfilter = ttykqfilter,
|
||||
};
|
||||
|
||||
|
@ -105,7 +105,7 @@ static struct cdevsw vt_cdevsw = {
|
||||
.d_mmap = pcvt_mmap,
|
||||
.d_name = "vt",
|
||||
.d_maj = CDEV_MAJOR,
|
||||
.d_flags = D_TTY | D_KQFILTER,
|
||||
.d_flags = D_TTY,
|
||||
.d_kqfilter = ttykqfilter,
|
||||
};
|
||||
|
||||
|
@ -544,7 +544,7 @@ static struct cdevsw stl_cdevsw = {
|
||||
.d_poll = ttypoll,
|
||||
.d_name = "stl",
|
||||
.d_maj = CDEV_MAJOR,
|
||||
.d_flags = D_TTY | D_KQFILTER,
|
||||
.d_flags = D_TTY,
|
||||
.d_kqfilter = ttykqfilter,
|
||||
};
|
||||
|
||||
|
@ -128,7 +128,7 @@ nokqfilter(dev, kn)
|
||||
struct knote *kn;
|
||||
{
|
||||
|
||||
return (ENODEV);
|
||||
return (1);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -79,7 +79,7 @@ static struct cdevsw cn_cdevsw = {
|
||||
.d_poll = cnpoll,
|
||||
.d_name = "console",
|
||||
.d_maj = CDEV_MAJOR,
|
||||
.d_flags = D_TTY | D_KQFILTER,
|
||||
.d_flags = D_TTY,
|
||||
.d_kqfilter = cnkqfilter,
|
||||
};
|
||||
|
||||
|
@ -85,7 +85,7 @@ static struct cdevsw pts_cdevsw = {
|
||||
.d_poll = ttypoll,
|
||||
.d_name = "pts",
|
||||
.d_maj = CDEV_MAJOR_S,
|
||||
.d_flags = D_TTY | D_KQFILTER,
|
||||
.d_flags = D_TTY,
|
||||
.d_kqfilter = ttykqfilter,
|
||||
};
|
||||
|
||||
@ -99,7 +99,7 @@ static struct cdevsw ptc_cdevsw = {
|
||||
.d_poll = ptcpoll,
|
||||
.d_name = "ptc",
|
||||
.d_maj = CDEV_MAJOR_C,
|
||||
.d_flags = D_TTY | D_KQFILTER,
|
||||
.d_flags = D_TTY,
|
||||
.d_kqfilter = ttykqfilter,
|
||||
};
|
||||
|
||||
|
@ -136,7 +136,6 @@ static struct cdevsw net_cdevsw = {
|
||||
.d_ioctl = netioctl,
|
||||
.d_name = "net",
|
||||
.d_maj = MAJOR_AUTO,
|
||||
.d_flags = D_KQFILTER,
|
||||
.d_kqfilter = netkqfilter,
|
||||
};
|
||||
|
||||
|
@ -415,7 +415,7 @@ static struct cdevsw sio_cdevsw = {
|
||||
.d_poll = ttypoll,
|
||||
.d_name = sio_driver_name,
|
||||
.d_maj = CDEV_MAJOR,
|
||||
.d_flags = D_TTY | D_KQFILTER,
|
||||
.d_flags = D_TTY,
|
||||
.d_kqfilter = ttykqfilter,
|
||||
};
|
||||
|
||||
|
@ -415,7 +415,7 @@ static struct cdevsw sio_cdevsw = {
|
||||
.d_poll = ttypoll,
|
||||
.d_name = sio_driver_name,
|
||||
.d_maj = CDEV_MAJOR,
|
||||
.d_flags = D_TTY | D_KQFILTER,
|
||||
.d_flags = D_TTY,
|
||||
.d_kqfilter = ttykqfilter,
|
||||
};
|
||||
|
||||
|
@ -221,7 +221,7 @@ static struct cdevsw sc_cdevsw = {
|
||||
.d_mmap = scmmap,
|
||||
.d_name = "sc",
|
||||
.d_maj = CDEV_MAJOR,
|
||||
.d_flags = D_TTY | D_KQFILTER,
|
||||
.d_flags = D_TTY,
|
||||
.d_kqfilter = ttykqfilter
|
||||
};
|
||||
|
||||
|
@ -213,7 +213,6 @@ typedef int dumper_t(
|
||||
#define D_NAGGED 0x00020000 /* nagged about missing make_dev() */
|
||||
#define D_TRACKCLOSE 0x00080000 /* track all closes */
|
||||
#define D_MMAP_ANON 0x00100000 /* special treatment in vm_mmap.c */
|
||||
#define D_KQFILTER 0x00200000 /* has kqfilter entry */
|
||||
#define D_NOGIANT 0x00400000 /* Doesn't want Giant */
|
||||
|
||||
/*
|
||||
|
@ -213,7 +213,6 @@ typedef int dumper_t(
|
||||
#define D_NAGGED 0x00020000 /* nagged about missing make_dev() */
|
||||
#define D_TRACKCLOSE 0x00080000 /* track all closes */
|
||||
#define D_MMAP_ANON 0x00100000 /* special treatment in vm_mmap.c */
|
||||
#define D_KQFILTER 0x00200000 /* has kqfilter entry */
|
||||
#define D_NOGIANT 0x00400000 /* Doesn't want Giant */
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user