Sun Aug 26 11:53:28 2018 UTC ()
Refactor the numeric validity check just added, so the error
messages can be (easily) done better.


(kre)
diff -r1.171 -r1.172 src/sys/kern/makesyscalls.sh

cvs diff -r1.171 -r1.172 src/sys/kern/makesyscalls.sh (expand / switch to unified diff)

--- src/sys/kern/makesyscalls.sh 2018/08/26 11:48:00 1.171
+++ src/sys/kern/makesyscalls.sh 2018/08/26 11:53:28 1.172
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: makesyscalls.sh,v 1.171 2018/08/26 11:48:00 kre Exp $ 1# $NetBSD: makesyscalls.sh,v 1.172 2018/08/26 11:53:28 kre Exp $
2# 2#
3# Copyright (c) 1994, 1996, 2000 Christopher G. Demetriou 3# Copyright (c) 1994, 1996, 2000 Christopher G. Demetriou
4# All rights reserved. 4# All rights reserved.
5# 5#
6# Redistribution and use in source and binary forms, with or without 6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions 7# modification, are permitted provided that the following conditions
8# are met: 8# are met:
9# 1. Redistributions of source code must retain the above copyright 9# 1. Redistributions of source code must retain the above copyright
10# notice, this list of conditions and the following disclaimer. 10# notice, this list of conditions and the following disclaimer.
11# 2. Redistributions in binary form must reproduce the above copyright 11# 2. Redistributions in binary form must reproduce the above copyright
12# notice, this list of conditions and the following disclaimer in the 12# notice, this list of conditions and the following disclaimer in the
13# documentation and/or other materials provided with the distribution. 13# documentation and/or other materials provided with the distribution.
14# 3. All advertising materials mentioning features or use of this software 14# 3. All advertising materials mentioning features or use of this software
@@ -68,32 +68,38 @@ sysautoload="/dev/null" @@ -68,32 +68,38 @@ sysautoload="/dev/null"
68rumpcalls="/dev/null" 68rumpcalls="/dev/null"
69rumpcallshdr="/dev/null" 69rumpcallshdr="/dev/null"
70rumpsysmap="/dev/null" 70rumpsysmap="/dev/null"
71rumpsysent="rumpsysent.tmp" 71rumpsysent="rumpsysent.tmp"
72rumpnoflags="\n\t\t.sy_flags = SYCALL_NOSYS," 72rumpnoflags="\n\t\t.sy_flags = SYCALL_NOSYS,"
73rumpnosys="(sy_call_t *)rumpns_enosys" 73rumpnosys="(sy_call_t *)rumpns_enosys"
74rumpnomodule="(sy_call_t *)rumpns_sys_nomodule" 74rumpnomodule="(sy_call_t *)rumpns_sys_nomodule"
75 75
76case $1 in 76case $1 in
77/*) . $1;; 77/*) . $1;;
78*) . ./$1;; 78*) . ./$1;;
79esac 79esac
80 80
 81errmsg()
 82{
 83 fail=true;
 84 printf '%s: %s\n' "$0" "$*" >&2
 85}
 86
81fail=false 87fail=false
82case "${nsysent:-0}" in 88case "${nsysent:-0}" in
83*[!0-9]*) fail=true; printf >&2 '%s\n' "Non numeric value for nsysent";; 89*[!0-9]*) errmsg "Non numeric value for nsysent:" "${nsysent}";;
84esac 90esac
85case "${maxsysargs:-0}" in 91case "${maxsysargs:-0}" in
86*[!0-9]*) fail=true; printf >&2 '%s\n' "Non numeric value for maxsysargs";; 92*[!0-9]*) errmsg "Non numeric value for maxsysargs:" "${maxsysargs}";;
87esac 93esac
88$fail && exit 1 94$fail && exit 1
89 95
90# tmp files: 96# tmp files:
91sysdcl="sysent.dcl" 97sysdcl="sysent.dcl"
92sysprotos="sys.protos" 98sysprotos="sys.protos"
93syscompat_pref="sysent." 99syscompat_pref="sysent."
94sysent="sysent.switch" 100sysent="sysent.switch"
95sysnamesbottom="$sysnames.bottom" 101sysnamesbottom="$sysnames.bottom"
96sysnamesfriendly="$sysnames.friendly" 102sysnamesfriendly="$sysnames.friendly"
97rumptypes="rumphdr.types" 103rumptypes="rumphdr.types"
98rumpprotos="rumphdr.protos" 104rumpprotos="rumphdr.protos"
99systracetmp="systrace.$$" 105systracetmp="systrace.$$"