[PATCH 4/4] Add compile option to disable error logging

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Leo Ruan <tingquan.ruan@xxxxxxxxxxxx>

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@xxxxxxxxxxxx>
Signed-off-by: Mark Jonas <mark.jonas@xxxxxxxxxxxx>
---
 src/libsocketcan.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/libsocketcan.c b/src/libsocketcan.c
index c4b95d9..60500cd 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)))
 
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-can" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux