[olsr-dev] [PATCH] Improvements in dot_draw plugin

Thomas Lopatic (spam-protected)
Mon Nov 14 22:02:23 CET 2005


[...]

> Hmm, the obvious replacement is to use `"%s", strerror(errno)`. But this
> doesnt' help either.
> So basically the question is: Should we kill the %m in olsr_syslog()
> calls?
> Or should we kill %m in all possibly non-Unix code?

[...]

I'd suggest that we move to the '"%s", strerror(errno)' combination.
That's what we currently also use for printf()s. Luckily each source
code file currently requires either GetLastError() or WSAGetLastError()
but not both at the same time. So, I define "errno" to be one of these
two functions and "strerror()" to be my substitute function that turns
an error code into an error message. Have a look at parser.c or
socket_parser.c as an example of this.

If we need GetLastError() and WSAGetLastError() in the same source code
file one day, we can think of extending our solution to this problem. :-)

-Thomas




More information about the Olsr-dev mailing list