[reSIProcate] [resiprocate/resiprocate] log errno names instead of values (#47)
Udit Raikwar
notifications at github.com
Thu Jun 16 12:59:29 CDT 2016
> +/*EMEDIUMTYPE 124 */ "EMEDIUMTYPE (Wrong medium type)",
> +/*ECANCELED 125 */ "ECANCELED (Operation canceled)",
> +/*ENOKEY 126 */ "ENOKEY (Required key not available)",
> +/*EKEYEXPIRED 127 */ "EKEYEXPIRED (Key has expired)",
> +/*EKEYREVOKED 128 */ "EKEYREVOKED (Key has been revoked)",
> +/*EKEYREJECTED 129 */ "EKEYREJECTED (Key was rejected by service)",
> +/*EOWNERDEAD 130 */ "EOWNERDEAD (Owner died)",
> +/*ENOTRECOVERABLE 131 */ "ENOTRECOVERABLE (State not recoverable)",
> +/*ERFKILL 132 */ "ERFKILL (Operation not possible due to RF-kill)",
> +/*EHWPOISON 133 */ "EHWPOISON (Memory page has hardware error)",
> +};
> +static const int NUM_MESSAGES_OS = sizeof(messagesOS)/sizeof(messagesOS[0]);
> +
> +static inline char* errortostringOS(int errnumOS)
> +{
> + if (errnumOS < NUM_MESSAGES_OS)
I made some changes to code
```
static inline char* errortostringOS(int errnumOS)
{
if ( (errnumOS >= 0 ) && (errnumOS < NUM_MESSAGES_OS))
return messagesOS[errnumOS];
return "Unknown error";
}
```
It is not possible for errnumOS to be negative, please read these two answers
[answer1](http://stackoverflow.com/a/25489728/4499919) [answer2](http://stackoverflow.com/a/18351359/4499919)
---
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/resiprocate/resiprocate/pull/47/files/097a30890d6dfb81cab790e992748d44ea1e6bf5#r67393861
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20160616/aa66be84/attachment.htm>
More information about the resiprocate-devel
mailing list