]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/gnu/errlist-compat.awk
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / sysdeps / gnu / errlist-compat.awk
index 0e97d05d665610458b092416efb6fa48766a7e50..202de93cc5b94ca161322e978ffa3b6ea8286c98 100644 (file)
@@ -1,5 +1,5 @@
 # awk script to generate errlist-compat.c
-# Copyright (C) 2002, 2004, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2002-2016 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 
 # The GNU C Library is free software; you can redistribute it and/or
@@ -81,10 +81,13 @@ END {
   if (highest > count) {
     printf "*** errlist.c count %d inflated to %s count %d (old errno.h?)\n", \
       count, highest_version, highest > "/dev/stderr";
-    printf "#define ERR_MAX %d\n\n", highest;
+    printf "#define ERR_MAX %d\n\n", highest - 1;
   }
 
-  for (old in compat) {
+  # same regardless of awk's ordering of the associative array.
+  num_compat_elems = asorti(compat, compat_indices)
+  for (i = 1; i <= num_compat_elems; i++) {
+    old = compat_indices[i]
     new = compat[old];
     n = vcount[old];
     printf "#if SHLIB_COMPAT (libc, %s, %s)\n", old, new;