Module Name: src Committed By: kre Date: Sun Aug 26 11:53:28 UTC 2018
Modified Files: src/sys/kern: makesyscalls.sh Log Message: Refactor the numeric validity check just added, so the error messages can be (easily) done better. To generate a diff of this commit: cvs rdiff -u -r1.171 -r1.172 src/sys/kern/makesyscalls.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/kern/makesyscalls.sh diff -u src/sys/kern/makesyscalls.sh:1.171 src/sys/kern/makesyscalls.sh:1.172 --- src/sys/kern/makesyscalls.sh:1.171 Sun Aug 26 11:48:00 2018 +++ src/sys/kern/makesyscalls.sh Sun Aug 26 11:53:28 2018 @@ -1,4 +1,4 @@ -# $NetBSD: makesyscalls.sh,v 1.171 2018/08/26 11:48:00 kre Exp $ +# $NetBSD: makesyscalls.sh,v 1.172 2018/08/26 11:53:28 kre Exp $ # # Copyright (c) 1994, 1996, 2000 Christopher G. Demetriou # All rights reserved. @@ -78,12 +78,18 @@ case $1 in *) . ./$1;; esac +errmsg() +{ + fail=true; + printf '%s: %s\n' "$0" "$*" >&2 +} + fail=false case "${nsysent:-0}" in -*[!0-9]*) fail=true; printf >&2 '%s\n' "Non numeric value for nsysent";; +*[!0-9]*) errmsg "Non numeric value for nsysent:" "${nsysent}";; esac case "${maxsysargs:-0}" in -*[!0-9]*) fail=true; printf >&2 '%s\n' "Non numeric value for maxsysargs";; +*[!0-9]*) errmsg "Non numeric value for maxsysargs:" "${maxsysargs}";; esac $fail && exit 1