From b76b4c2c3b974afa062d9fa087c18fd3483cbf8a Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sun, 7 Oct 2007 21:52:47 +0200 Subject: [PATCH] error.h: Make PARA_STRERROR understand system errors. --- error.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/error.h b/error.h index d648f14e..5ed38304 100644 --- a/error.h +++ b/error.h @@ -521,7 +521,11 @@ extern const char **para_errlist[]; * * expands to the error text of \a num (a string constant). */ -#define PARA_STRERROR(num) para_errlist[ERRNUM_TO_SS(num)] [ERRNUM_TO_INDEX(num)] +#define PARA_STRERROR(num) (num) & (1 << 30)? \ + strerror((num) & ((1 << 30) - 1)) : \ + para_errlist[ERRNUM_TO_SS(num)] [ERRNUM_TO_INDEX(num)] + +#define ERRNO_TO_PARA_ERROR(num) (-((num) | (1 << 30))) /** * define the error list for one subsystem -- 2.39.5