Sun Jul 7 18:42:06 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
authorroland <roland>
Sun, 7 Jul 1996 23:54:27 +0000 (23:54 +0000)
committerroland <roland>
Sun, 7 Jul 1996 23:54:27 +0000 (23:54 +0000)
* sysdeps/gnu/errlist.awk (BEGIN): Initialize associative array ALIAS,
map EWOULDBLOCK->EAGAIN, EDEADLOCK->EDEADLK.
(element printer): Check for elt in ALIAS, instead of special case
for EWOULDBLOCK.

sysdeps/gnu/errlist.awk

index d14348f..e6ca81a 100644 (file)
@@ -23,6 +23,9 @@
 # @comment errno 78
 
 BEGIN {
+    alias["EWOULDBLOCK"] = "EAGAIN";
+    alias["EDEADLOCK"] = "EDEADLK";
+
     print "/* This file is generated from errno.texi by errlist.awk.  */"
     print "";
     print "#include <errno.h>";
@@ -47,8 +50,8 @@ errnoh == 2 && $1 == "@deftypevr" && $2 == "Macro" && $3 == "int" \
 errnoh == 3 && $1 == "@comment" && $2 == "errno" \
   {
     errno = $3 + 0;
-    if (e == "EWOULDBLOCK")
-      print "#if defined (EWOULDBLOCK) && EWOULDBLOCK != EAGAIN";
+    if (alias[e])
+      printf "#if defined (%s) && %s != %s\n", e, e, alias[e];
     else
       printf "#ifdef %s\n", e;
     printf "    [%s] = N_(\"%s\"),\n", e, etext;