From nobody@FreeBSD.org  Wed Aug 22 20:43:30 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id D745D37B409
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 22 Aug 2001 20:43:29 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.4/8.11.4) id f7N3hTZ24329;
	Wed, 22 Aug 2001 20:43:29 -0700 (PDT)
	(envelope-from nobody)
Message-Id: <200108230343.f7N3hTZ24329@freefall.freebsd.org>
Date: Wed, 22 Aug 2001 20:43:29 -0700 (PDT)
From: Joseph Mallett <jmallett@xMach.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: variables are named inconsistently in MAKEDEV
X-Send-Pr-Version: www-1.0

>Number:         29971
>Category:       misc
>Synopsis:       variables are named inconsistently in MAKEDEV
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 22 20:50:01 PDT 2001
>Closed-Date:    Thu Aug 23 15:19:55 PDT 2001
>Last-Modified:  Thu Aug 23 15:20:08 PDT 2001
>Originator:     Joseph Mallett
>Release:        RELENG_4
>Organization:
xMach
>Environment:
NA
>Description:
There seems to be a convention in MAKEDEV to use 'units' as the number of units of a particular device major to create (and it is used to generate sequential minors and device names, etc.). However, a few locations stray from this and use names like 'nbpf' or 'ntun'.
>How-To-Repeat:
grep ntap MAKEDEV
>Fix:

--- makedev.orig	Mon Aug 20 11:39:53 2001
+++ MAKEDEV	Mon Aug 20 11:49:49 2001
@@ -1079,9 +1079,9 @@
 	;;
 
 bpf*)
-	nbpf=`expr $i : 'bpf\(.*\)$'`
+	units=`expr $i : 'bpf\(.*\)$'`
 	unit=0
-	while [ $unit -le $nbpf ]; do
+	while [ $unit -le $units ]; do
 		mknod bpf$unit c 23 `unit2minor $unit`
 		unit=$(($unit + 1))
 	done
@@ -1164,9 +1164,9 @@
 #       the manual that comes with the system.
 ttyA*)
 	major=68
-	nports=`expr $i : 'ttyA\(.*\)$'`
+	units=`expr $i : 'ttyA\(.*\)$'`
 	port=1
-	while [ $port -le $nports ]; do
+	while [ $port -le $units ]; do
 		minor=$(expr $port - 1)
 		name=$(printf %02d $port)
 		mknod ttyA$name c $major $minor
@@ -1181,9 +1181,9 @@
 cuaA*)
 	umask 7
 	major=68
-	nports=`expr $i : 'cuaA\(.*\)$'`
+	units=`expr $i : 'cuaA\(.*\)$'`
 	port=1
-	while [ $port -le $nports ]; do
+	while [ $port -le $units ]; do
 		minor=$(expr $port - 1)
 		name=$(printf %02d $port)
 		mknod cuaA$name c $major `expr $minor + 128` uucp:dialer
@@ -1541,18 +1541,18 @@
 	;;
 
 tun*)
-	ntun=`expr $i : 'tun\(.*\)$'`
+	units=`expr $i : 'tun\(.*\)$'`
 	unit=0
-	while [ $unit -le $ntun ]; do
+	while [ $unit -le $units ]; do
 		mknod tun$unit c 52 `unit2minor $unit`
 		unit=$(($unit + 1))
 	done
 	;;
 
 tap*)
-	ntap=`expr $i : 'tap\(.*\)$'`
+	units=`expr $i : 'tap\(.*\)$'`
 	unit=0
-	while [ $unit -le $ntap ]; do
+	while [ $unit -le $units ]; do
 		mknod tap$unit c 149 `unit2minor $unit` root:network
 		unit=$(($unit + 1))
 	done

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: dd 
State-Changed-When: Thu Aug 23 15:19:55 PDT 2001 
State-Changed-Why:  
applied to -current, thanks! 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=29971 
>Unformatted:
