Add compile option to disable error logging
If you have an application stderr shall not be used by libsocketcan you can disable all error logging by defining DISABLE_ERROR_LOG. Signed-off-by: Leo Ruan <tingquan.ruan@cn.bosch.com> Signed-off-by: Mark Jonas <mark.jonas@de.bosch.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>pull/106/head^2
parent
9679a3f50a
commit
15af38a25c
|
|
@ -36,6 +36,12 @@
|
||||||
|
|
||||||
#include <libsocketcan.h>
|
#include <libsocketcan.h>
|
||||||
|
|
||||||
|
/* Define DISABLE_ERROR_LOG to disable printing of error messages to stderr. */
|
||||||
|
#ifdef DISABLE_ERROR_LOG
|
||||||
|
#define perror(x)
|
||||||
|
#define fprintf(...)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define parse_rtattr_nested(tb, max, rta) \
|
#define parse_rtattr_nested(tb, max, rta) \
|
||||||
(parse_rtattr((tb), (max), RTA_DATA(rta), RTA_PAYLOAD(rta)))
|
(parse_rtattr((tb), (max), RTA_DATA(rta), RTA_PAYLOAD(rta)))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue