diff options
author | Leo Ruan <tingquan.ruan@cn.bosch.com> | 2018-08-04 20:07:43 +0200 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2018-08-08 12:28:57 +0200 |
commit | 15af38a25c679d3ed0f72bbc1109c6b34a959c39 (patch) | |
tree | 246c4ae7a36910c16adb14b45b0d00fd44c5cccc | |
parent | 9679a3f50a14b2c864889c6da56a7cdbaa7b1f9b (diff) | |
download | libsocketcan-15af38a25c679d3ed0f72bbc1109c6b34a959c39.tar.gz libsocketcan-15af38a25c679d3ed0f72bbc1109c6b34a959c39.tar.xz |
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>
-rw-r--r-- | src/libsocketcan.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libsocketcan.c b/src/libsocketcan.c index a1a4717..5c7665c 100644 --- a/src/libsocketcan.c +++ b/src/libsocketcan.c @@ -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))) |