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

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

 



On 08/04/2018 08:07 PM, Mark Jonas wrote:
> 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)))
>  
> 

Can you add a configure switch for this?

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

Attachment: signature.asc
Description: OpenPGP digital signature


[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