Commit a27a4550 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Fix --syslog

psz_logmode is tested for NULLity, so we need to use *NonEmpty*.
Also, always delete the variable. If the reference count was 1, we will
revert back to the configuration value, which makes no difference.
parent f0040526
...@@ -946,7 +946,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, ...@@ -946,7 +946,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
#ifdef HAVE_SYSLOG_H #ifdef HAVE_SYSLOG_H
if( config_GetInt( p_libvlc, "syslog" ) > 0 ) if( config_GetInt( p_libvlc, "syslog" ) > 0 )
{ {
char *logmode = var_CreateGetString( p_libvlc, "logmode" ); char *logmode = var_CreateGetNonEmptyString( p_libvlc, "logmode" );
var_SetString( p_libvlc, "logmode", "syslog" ); var_SetString( p_libvlc, "logmode", "syslog" );
intf_Create( p_libvlc, "logger,none" ); intf_Create( p_libvlc, "logger,none" );
...@@ -955,8 +955,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, ...@@ -955,8 +955,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
var_SetString( p_libvlc, "logmode", logmode ); var_SetString( p_libvlc, "logmode", logmode );
free( logmode ); free( logmode );
} }
else var_Destroy( p_libvlc, "logmode" );
var_Destroy( p_libvlc, "logmode" );
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment