From 65c141be411582e64baac599b2901741bcda5305 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Tue, 5 Jun 2012 18:09:29 +0100 Subject: [PATCH] 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. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ' > 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 -- 2.39.5