summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2012-06-05 18:09:29 +0100
committerLars Wirzenius <liw@liw.fi>2012-06-05 18:09:29 +0100
commit65c141be411582e64baac599b2901741bcda5305 (patch)
treee4f67d8adb7911e106a5d4a818f6c65c56ac2b73
parentb2e99d6976f1163e674542c9c9f3a9242ace6ac2 (diff)
Change how errno values are printed, for portability
Reported and suggested by Pino Toscano: The Hurd does not #define the EFOO constants as simple integers, but as expressions. This made the code that generates errnos.h to misinterpret the value, and always print 0 for every error code. We fix this by instead using the EFOO macro in errnos.h, so that the preprocessor evaluates it correctly. This is the right thing to do anyway, for every platform. Thus the table changes from {"EFOO",42} to {"EFOO",EFOO} for each entry.
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index e798a98..21af683 100644
--- a/Makefile
+++ b/Makefile
@@ -50,7 +50,7 @@ parallel.1: parallel.docbook
errno.o: errnos.h
errnos.h:
echo '#include <errno.h>' > dump.c
- $(CC) -E -dD dump.c | awk '/^#define E/ { printf "{\"%s\",%d},\n", $$2, $$3 }' > errnos.h
+ $(CC) -E -dD dump.c | awk '/^#define E/ { printf "{\"%s\",%s},\n", $$2, $$2 }' > errnos.h
rm -f dump.c
errno.1: errno.docbook