[vlc-commits] logger: don't use NULL FILE* on android

Rafaël Carré git at videolan.org
Wed Jan 25 17:48:13 CET 2012


vlc/vlc-2.0 | branch: master | Rafaël Carré <funman at videolan.org> | Wed Jan 25 04:00:46 2012 -0500| [2855320a5abab4a7a730161ac671a7c993668ee5] | committer: Jean-Baptiste Kempf

logger: don't use NULL FILE* on android
(cherry picked from commit 8d2f07b0b9716aac58d0c294371cb8147589ba19)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=2855320a5abab4a7a730161ac671a7c993668ee5
---

 modules/misc/logger.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/modules/misc/logger.c b/modules/misc/logger.c
index 481d262..9ee7cde 100644
--- a/modules/misc/logger.c
+++ b/modules/misc/logger.c
@@ -201,6 +201,7 @@ static int Open( vlc_object_t *p_this )
     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;
@@ -326,6 +327,7 @@ static void Close( vlc_object_t *p_this )
         closelog();
     else
 #endif
+    if( p_sys->p_file )
     {
         fputs( p_sys->footer, p_sys->p_file );
         fclose( p_sys->p_file );



More information about the vlc-commits mailing list