[vlc-devel] commit: strerror(errno) is not thread-safe, use %m ( Rémi Denis-Courmont )

git version control git at videolan.org
Tue Oct 6 21:59:12 CEST 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Oct  6 22:56:50 2009 +0300| [b19adbaf92e2c3068fe0b1031afde2dd97b8eaf2] | committer: Rémi Denis-Courmont 

strerror(errno) is not thread-safe, use %m

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

 modules/gui/fbosd.c                                |    4 ++--
 .../video_filter/dynamicoverlay/dynamicoverlay.c   |   14 ++++++--------
 modules/video_output/omapfb.c                      |    8 ++++----
 3 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/modules/gui/fbosd.c b/modules/gui/fbosd.c
index 7391379..17d4b46 100644
--- a/modules/gui/fbosd.c
+++ b/modules/gui/fbosd.c
@@ -1062,7 +1062,7 @@ static int OpenDisplay( intf_thread_t *p_intf )
     p_sys->i_fd = open( psz_device, O_RDWR );
     if( p_sys->i_fd == -1 )
     {
-        msg_Err( p_intf, "cannot open %s (%s)", psz_device, strerror(errno) );
+        msg_Err( p_intf, "cannot open %s (%m)", psz_device );
         free( psz_device );
         return VLC_EGENERIC;
     }
@@ -1071,7 +1071,7 @@ static int OpenDisplay( intf_thread_t *p_intf )
     /* Get framebuffer device information */
     if( ioctl( p_sys->i_fd, FBIOGET_VSCREENINFO, &p_sys->var_info ) )
     {
-        msg_Err( p_intf, "cannot get fb info (%s)", strerror(errno) );
+        msg_Err( p_intf, "cannot get fb info (%m)" );
         close( p_sys->i_fd );
         return VLC_EGENERIC;
     }
diff --git a/modules/video_filter/dynamicoverlay/dynamicoverlay.c b/modules/video_filter/dynamicoverlay/dynamicoverlay.c
index 77d6e05..016ecb0 100644
--- a/modules/video_filter/dynamicoverlay/dynamicoverlay.c
+++ b/modules/video_filter/dynamicoverlay/dynamicoverlay.c
@@ -173,8 +173,8 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
         p_sys->i_inputfd = open( p_sys->psz_inputfile, O_RDONLY | O_NONBLOCK );
         if( p_sys->i_inputfd == -1 )
         {
-            msg_Warn( p_filter, "Failed to grab input file: %s (%s)",
-                      p_sys->psz_inputfile, strerror( errno ) );
+            msg_Warn( p_filter, "Failed to grab input file: %s (%m)",
+                      p_sys->psz_inputfile );
         }
         else
         {
@@ -191,8 +191,8 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
         {
             if( errno != ENXIO )
             {
-                msg_Warn( p_filter, "Failed to grab output file: %s (%s)",
-                          p_sys->psz_outputfile, strerror( errno ) );
+                msg_Warn( p_filter, "Failed to grab output file: %s (%m)",
+                          p_sys->psz_outputfile );
             }
         }
         else
@@ -213,8 +213,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
             /* We hit an error */
             if( errno != EAGAIN )
             {
-                msg_Warn( p_filter, "Error on input file: %s",
-                          strerror( errno ) );
+                msg_Warn( p_filter, "Error on input file: %m" );
                 close( p_sys->i_inputfd );
                 p_sys->i_inputfd = -1;
             }
@@ -321,8 +320,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
             /* We hit an error */
             if( errno != EAGAIN )
             {
-                msg_Warn( p_filter, "Error on output file: %s",
-                          strerror( errno ) );
+                msg_Warn( p_filter, "Error on output file: %m" );
                 close( p_sys->i_outputfd );
                 p_sys->i_outputfd = -1;
             }
diff --git a/modules/video_output/omapfb.c b/modules/video_output/omapfb.c
index 3a1c7f3..f4b21d0 100644
--- a/modules/video_output/omapfb.c
+++ b/modules/video_output/omapfb.c
@@ -478,13 +478,13 @@ static int OpenDisplay( vout_thread_t *p_vout )
 
     if( ioctl( p_sys->i_fd, FBIOGET_VSCREENINFO, &p_sys->fb_vinfo ) )
     {
-        msg_Err( p_vout, "Can't get VSCREENINFO: %s", strerror(errno) );
+        msg_Err( p_vout, "Can't get VSCREENINFO: %m" );
         close( p_sys->i_fd );
         return VLC_EGENERIC;
     }
     if( ioctl( p_sys->i_fd, FBIOGET_FSCREENINFO, &p_sys->fb_finfo ) )
     {
-        msg_Err( p_vout, "Can't get FSCREENINFO: %s", strerror(errno) );
+        msg_Err( p_vout, "Can't get FSCREENINFO: %m" );
         close( p_sys->i_fd );
         return VLC_EGENERIC;
     }
@@ -496,7 +496,7 @@ static int OpenDisplay( vout_thread_t *p_vout )
     if( (p_sys->p_video = (uint8_t *)mmap( 0, p_sys->i_page_size, PROT_READ | PROT_WRITE, MAP_SHARED,
                                             p_sys->i_fd, 0 )) == MAP_FAILED )
     {
-        msg_Err( p_vout, "Can't mmap: %s", strerror(errno) );
+        msg_Err( p_vout, "Can't mmap: %m" );
         close( p_sys->i_fd );
         return VLC_EGENERIC;
     }
@@ -516,7 +516,7 @@ static int OpenDisplay( vout_thread_t *p_vout )
     if( (p_sys->p_null = (uint8_t *)mmap( 0, p_sys->i_page_size, PROT_READ | PROT_WRITE,
                                           MAP_PRIVATE, p_sys->i_null_fd, 0 )) == MAP_FAILED )
     {
-        msg_Err( p_vout, "Can't mmap 2: %s", strerror(errno) );
+        msg_Err( p_vout, "Can't mmap 2: %m" );
         munmap( p_sys->p_video, p_sys->i_page_size );
         close( p_sys->i_null_fd );
         close( p_sys->i_fd );




More information about the vlc-devel mailing list