From 72a5ed2e2661b586d554445ec7dfb89300d0c252 Mon Sep 17 00:00:00 2001 From: itojun Date: Sun, 9 Jan 2000 02:37:06 +0000 Subject: [PATCH] allow "sh MAKEDEV ttyNN", where NN is 00 to 99. single-digit "sh MAKEDEV ttyN" works in backward-compatible way. XXX should bring it to other ports as well? --- etc/etc.i386/MAKEDEV | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/etc/etc.i386/MAKEDEV b/etc/etc.i386/MAKEDEV index b9b26de7a846..f1111356442f 100644 --- a/etc/etc.i386/MAKEDEV +++ b/etc/etc.i386/MAKEDEV @@ -1,6 +1,6 @@ #!/bin/sh - # -# $NetBSD: MAKEDEV,v 1.98 1999/12/18 03:09:47 tsutsui Exp $ +# $NetBSD: MAKEDEV,v 1.99 2000/01/09 02:37:06 itojun Exp $ # # Copyright (c) 1990 The Regents of the University of California. # All rights reserved. @@ -388,11 +388,18 @@ ccd*|fd*|sd*|vnd*|wd*|raid*) ;; com*|tty*) # (XXX -- com should die) - unit=${i#???} - rm -f com$unit tty0$unit dty0$unit - mknod tty0$unit c 8 $(($unit + $dialin )) - mknod dty0$unit c 8 $(($unit + $dialout)) - chown uucp.wheel tty0$unit dty0$unit + ounit=${i#???} + ounit=$(($ounit + 0)) + if [ $ounit -lt 10 ]; then + unit=0$ounit + rm -f com$ounit + else + unit=$ounit + fi + rm -f tty$unit dty$unit + mknod tty$unit c 8 $(($ounit + $dialin )) + mknod dty$unit c 8 $(($ounit + $dialout)) + chown uucp.wheel tty$unit dty$unit ;; pty*)