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
Leo Ruan 2018-08-04 20:07:43 +02:00 committed by Marc Kleine-Budde
parent 9679a3f50a
commit 15af38a25c
1 changed files with 6 additions and 0 deletions

View File

@ -36,6 +36,12 @@
#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) \
(parse_rtattr((tb), (max), RTA_DATA(rta), RTA_PAYLOAD(rta)))