From 5ac5d56571c53404a06f5c5ad1807d911fbc56ba Mon Sep 17 00:00:00 2001 From: todd <> Date: Tue, 4 Sep 2001 20:16:46 +0000 Subject: [PATCH] shave 40% off 'MAKEDEV all' by combining(eliminating) 'chgrp' fork's --- src/etc/etc.sparc64/MAKEDEV | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/etc/etc.sparc64/MAKEDEV b/src/etc/etc.sparc64/MAKEDEV index 166a0be9..43661300 100644 --- a/src/etc/etc.sparc64/MAKEDEV +++ b/src/etc/etc.sparc64/MAKEDEV @@ -1,7 +1,7 @@ #!/bin/sh - # -# $OpenBSD: MAKEDEV,v 1.5 2001/09/04 19:17:06 todd Exp $ +# $OpenBSD: MAKEDEV,v 1.6 2001/09/04 20:16:46 todd Exp $ # # Copyright (c) 2001 Todd T. Fries # All rights reserved. @@ -81,8 +81,6 @@ # PATH=/sbin:/usr/sbin:/bin:/usr/bin T=$0 - -# default shell support functions hex() { case $1 in @@ -165,11 +163,19 @@ M() { [ "$G" ] && { [ "$7" ] && { MKlist="$MKlist;chown $7.$G $1" - } || MKlist="$MKlist;chgrp $G $1" + } || cgp $G $1 } return 0 } - +cgp() { + G=$1 + [ "${grplist[$G]}" ] && { + grplist[$G]="${grplist[$G]} $2" + } || { + groups="$groups $G" + grplist[$G]="chgrp $G $2" + } +} R() { for i in "$@" do @@ -354,9 +360,7 @@ st*) ses*) M ses$U c 4 $U 640 operator;; ch*) M ch$U c 19 $U 660 operator;; -lkm) - M lkm c 112 0 640 kmem - ;; +lkm)M lkm c 112 0 640 kmem;; xfs*) M xfs$U c 51 $U 600;; *random) n=0 @@ -397,4 +401,7 @@ $eo eval $RMlist for mode in $modes; do $eo eval ${mklist[$mode]} done +for group in $groups; do + $eo eval ${grplist[$groupl]} +done $eo eval $MKlist