strerror(errno) is not thread-safe, use %m
authorRémi Denis-Courmont <remi@remlab.net>
Tue, 6 Oct 2009 19:56:50 +0000 (22:56 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Tue, 6 Oct 2009 19:57:18 +0000 (22:57 +0300)
modules/gui/fbosd.c
modules/video_filter/dynamicoverlay/dynamicoverlay.c
modules/video_output/omapfb.c

index 7391379..17d4b46 100644 (file)
@@ -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;
     }
index 77d6e05..016ecb0 100644 (file)
@@ -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;
             }
index 3a1c7f3..f4b21d0 100644 (file)
@@ -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 );