From: Andre Noll Date: Sun, 7 Oct 2007 19:52:47 +0000 (+0200) Subject: error.h: Make PARA_STRERROR understand system errors. X-Git-Tag: v0.3.0~293 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=b76b4c2c3b974afa062d9fa087c18fd3483cbf8a error.h: Make PARA_STRERROR understand system errors. --- 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