if( p_sys == NULL )
return VLC_ENOMEM;
+ p_sys->p_file = NULL;
msg_callback_t cb = TextPrint;
const char *filename = LOG_FILE_TEXT, *header = TEXT_HEADER;
p_sys->footer = TEXT_FOOTER;
else
#endif
#ifdef __ANDROID__
- if( cb != AndroidPrint )
+ if( cb == AndroidPrint )
+ {
+ /* nothing to do */
+ }
+ else
#endif
{
char *psz_file = var_InheritString( p_intf, "logfile" );
if( !psz_file )
{
#ifdef __APPLE__
-# define LOG_DIR "Library/Logs/"
- char *home = config_GetUserDir(VLC_DOCUMENTS_DIR);
+# define LOG_DIR "Library/Logs"
+ char *home = config_GetUserDir(VLC_HOME_DIR);
if( home == NULL
|| asprintf( &psz_file, "%s/"LOG_DIR"/%s", home,
filename ) == -1 )
closelog();
else
#endif
+ if( p_sys->p_file )
{
fputs( p_sys->footer, p_sys->p_file );
fclose( p_sys->p_file );