[vlc-devel] [PATCH] logger: Add --syslog-ident parameter.
Konstantin Pavlov
thresh at videolan.org
Fri Mar 15 10:53:28 CET 2013
On Wed, Mar 06, 2013 at 08:36:54PM +0200, Georgi Chorbadzhiyski wrote:
> By default VLC uses "vlc" as syslog ident but in case more than one
> VLC is running on the host it is difficult to distinguish what different
> processes are logging. The pid is not enough and may not even make sense
> when sysloged messages are sent to another host.
>
> This commit introduces --syslog-ident parameter which allows setting
> of the ident.
> ---
> modules/misc/logger.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> - openlog( "vlc", LOG_PID|LOG_NDELAY, i_facility );
> + char *syslog_ident = var_InheritString( p_intf, "syslog-ident" );
> + const char *ident = syslog_ident ? syslog_ident : "vlc";
> + openlog( ident, LOG_PID|LOG_NDELAY, i_facility );
> + free( syslog_ident );
According to openlog manual, you must not free the pointer ident points
to: http://www.gnu.org/software/libc/manual/html_node/openlog.html
--
VideoLAN
Konstantin Pavlov
http://www.videolan.org
Mobile: +7 926 165 45 31
Skype: cryothresh
Twitter: @cryothresh
More information about the vlc-devel
mailing list