[vlc-devel] commit: msg_(va)Generic: cancellation safety ( Rémi Denis-Courmont )

git version control git at videolan.org
Wed Aug 27 22:57:28 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sun Jul  6 21:34:32 2008 +0300| [40c8f3c3af7a805b6153f19e3b3f515d7487db0f] | committer: Rémi Denis-Courmont 

msg_(va)Generic: cancellation safety

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=40c8f3c3af7a805b6153f19e3b3f515d7487db0f
---

 src/misc/messages.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/misc/messages.c b/src/misc/messages.c
index be832c6..a3e1f47 100644
--- a/src/misc/messages.c
+++ b/src/misc/messages.c
@@ -333,6 +333,7 @@ static void QueueMsg( vlc_object_t *p_this, int i_type, const char *psz_module,
 
     if( psz_str == NULL )
     {
+        int canc = vlc_savecancel (); /* Do not print half of a message... */
 #ifdef __GLIBC__
         fprintf( stderr, "main warning: can't store message (%m): " );
 #else
@@ -352,6 +353,7 @@ static void QueueMsg( vlc_object_t *p_this, int i_type, const char *psz_module,
         vfprintf( stderr, psz_format, args );
         va_end( args );
         fputs( "\n", stderr );
+        vlc_restorecancel (canc);
         return;
     }
 
@@ -547,6 +549,7 @@ static void PrintMsg ( vlc_object_t * p_this, msg_item_t * p_item )
 
     psz_object = p_item->psz_object_type;
 
+    int canc = vlc_savecancel ();
 #ifdef UNDER_CE
 #   define CE_WRITE(str) WriteFile( QUEUE.logfile, \
                                     str, strlen(str), &i_dummy, NULL );
@@ -599,6 +602,7 @@ static void PrintMsg ( vlc_object_t * p_this, msg_item_t * p_item )
 #   if defined(WIN32)
     fflush( stderr );
 #   endif
+    vlc_restorecancel (canc);
 #endif
 }
 




More information about the vlc-devel mailing list