Bug 25761

Summary: Off-by-one error in MAKEDEV wrt. pass(4) device.
Product: Base System Reporter: todd.showalter <todd.showalter>
Component: miscAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.2-STABLE   
Hardware: Any   
OS: Any   

Description todd.showalter 2001-03-13 05:10:01 UTC
If you:

> su
# cd /dev
# MAKEDEV pass4

    You only get /dev/pass0 - /dev/pass3; I noticed this because tosha
wouldn't access my cdrom drive.

Fix: 

UNTESTED!

Change the CAM passthrough code in MAKEDEV from:

        while [ $i -lt $units ]; do
to
        while [ $i -le $units ]; do

    As I understand what's going on, this is the Right Thing.
Comment 1 mjacob 2001-03-14 04:36:25 UTC
I don't think this is quite right. The MAKEDEV script's man page doesn't say
this, but for the few devices where the numeric argument is not the actual
unit number you want created it seems that this is more an 'amount', so doing

MAKEDEV pass4

creates 4 pass devices (0..3). This code seems to probably have started with
the vty devices. The comment in MAKEDEV appears to be:

# Use this to create virtual consoles for syscons, pcvt or codrv
# ttyv0-b
# use as MAKEDEV vtyNN to create NN entries

So, I think we can basically say, "Not a bug".

-matt
Comment 2 Matt Jacob freebsd_committer freebsd_triage 2001-03-14 04:44:11 UTC
State Changed
From-To: open->closed

Sorry- not really a bug.
Comment 3 Kris Kennaway 2001-04-22 05:41:52 UTC
On Mon, Mar 12, 2001 at 09:01:52PM -0800, todd.showalter@home.com wrote:

> > su
> # cd /dev
> # MAKEDEV pass4
> 
>     You only get /dev/pass0 - /dev/pass3; I noticed this because tosha
> wouldn't access my cdrom drive.


I think this is the desired behaviour.

Kris