Pull the rug under block mode devices. they return ENXIO on open(2) now.
This commit is contained in:
parent
aec15566c7
commit
f101401a90
@ -146,14 +146,14 @@ spec_open(ap)
|
||||
if (vp->v_mount && (vp->v_mount->mnt_flag & MNT_NODEV))
|
||||
return (ENXIO);
|
||||
|
||||
if (vp->v_type == VBLK && !(dev->si_flags & SI_WHINED)) {
|
||||
if (vp->v_type == VBLK) {
|
||||
if (*dev->si_name != '\0')
|
||||
printf("Device \"%s\" ", dev->si_name);
|
||||
else
|
||||
printf("Device char-major=%d minor=0x%x ",
|
||||
major(dev), minor(dev));
|
||||
printf("opened in block mode, convert to char mode with /dev/MAKEDEV before 2000-07-01\n");
|
||||
dev->si_flags |= SI_WHINED;
|
||||
printf("failed attempt to open in block mode\n");
|
||||
return ENXIO;
|
||||
}
|
||||
dsw = devsw(dev);
|
||||
if ( (dsw == NULL) || (dsw->d_open == NULL))
|
||||
|
@ -146,14 +146,14 @@ spec_open(ap)
|
||||
if (vp->v_mount && (vp->v_mount->mnt_flag & MNT_NODEV))
|
||||
return (ENXIO);
|
||||
|
||||
if (vp->v_type == VBLK && !(dev->si_flags & SI_WHINED)) {
|
||||
if (vp->v_type == VBLK) {
|
||||
if (*dev->si_name != '\0')
|
||||
printf("Device \"%s\" ", dev->si_name);
|
||||
else
|
||||
printf("Device char-major=%d minor=0x%x ",
|
||||
major(dev), minor(dev));
|
||||
printf("opened in block mode, convert to char mode with /dev/MAKEDEV before 2000-07-01\n");
|
||||
dev->si_flags |= SI_WHINED;
|
||||
printf("failed attempt to open in block mode\n");
|
||||
return ENXIO;
|
||||
}
|
||||
dsw = devsw(dev);
|
||||
if ( (dsw == NULL) || (dsw->d_open == NULL))
|
||||
|
@ -53,7 +53,6 @@ struct vnode;
|
||||
struct specinfo {
|
||||
u_int si_flags;
|
||||
#define SI_STASHED 0x0001 /* created in stashed storage */
|
||||
#define SI_WHINED 0x0002 /* whined about already */
|
||||
udev_t si_udev;
|
||||
LIST_ENTRY(specinfo) si_hash;
|
||||
SLIST_HEAD(, vnode) si_hlist;
|
||||
|
@ -53,7 +53,6 @@ struct vnode;
|
||||
struct specinfo {
|
||||
u_int si_flags;
|
||||
#define SI_STASHED 0x0001 /* created in stashed storage */
|
||||
#define SI_WHINED 0x0002 /* whined about already */
|
||||
udev_t si_udev;
|
||||
LIST_ENTRY(specinfo) si_hash;
|
||||
SLIST_HEAD(, vnode) si_hlist;
|
||||
|
Loading…
Reference in New Issue
Block a user