shithub: scc

Download patch

ref: 17aed0d5adf9cefd6e4c48069be50e046f7fbdee
parent: c3eecdc3f4430d487ce231afdf9bde29aa111099
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Tue Sep 14 12:33:30 EDT 2021

libc: Remove _sys_nerr

_sys_nerr variable is not needed anymore because there is
a macro with the maximum number of errors that does the
same work.

--- a/src/libc/arch/mkerrstr
+++ b/src/libc/arch/mkerrstr
@@ -1,7 +1,5 @@
-#!/bin/sh
+trap 'rm -f $$.tmp' EXIT HUP INT QUIT TERM
 
-trap 'r=$?; rm -f $$.tmp; exit $r' EXIT HUP INT QUIT TERM
-
 awk '
 /^#define[ \t]*E/{
 	str = ""
@@ -9,8 +7,6 @@
 		str = str " " $i
 	sub(/^ /, "", str)
 	errstr[$2] = str
-	if ($3 > max)
-		max = $3;
 }
 
 END {
@@ -20,5 +16,4 @@
 		printf "\t%-20.20s = \"%s\",\n", "[" i "]", errstr[i]
 
 	print "};"
-	print "const int _sys_nerr =", max";"
 }' $@ > $$.tmp && mv $$.tmp _sys_errlist.c