[vlc-commits] Linsys: don't use strerror

Jean-Baptiste Kempf git at videolan.org
Sun Jan 23 20:36:22 CET 2011


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Jan 23 20:23:46 2011 +0100| [e2df0a99df40af9c5cfd2da61080206b7aa00b02] | committer: Jean-Baptiste Kempf

Linsys: don't use strerror

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

 modules/access/linsys/linsys_hdsdi.c |   39 +++++++++++++--------------------
 modules/access/linsys/linsys_sdi.c   |   10 ++++----
 2 files changed, 20 insertions(+), 29 deletions(-)

diff --git a/modules/access/linsys/linsys_hdsdi.c b/modules/access/linsys/linsys_hdsdi.c
index 3c7752b..90ccd70 100644
--- a/modules/access/linsys/linsys_hdsdi.c
+++ b/modules/access/linsys/linsys_hdsdi.c
@@ -686,7 +686,7 @@ static int InitCapture( demux_t *p_demux )
 
         if ( poll( pfd, 1, READ_TIMEOUT ) < 0 )
         {
-            msg_Warn( p_demux, "couldn't poll(): %s", strerror(errno) );
+            msg_Warn( p_demux, "couldn't poll(): %m" );
             close( p_sys->i_vfd );
             return VLC_EGENERIC;
         }
@@ -696,8 +696,7 @@ static int InitCapture( demux_t *p_demux )
             unsigned int i_val;
 
             if ( ioctl( p_sys->i_vfd, SDIVIDEO_IOC_RXGETEVENTS, &i_val ) < 0 )
-                msg_Warn( p_demux, "couldn't SDIVIDEO_IOC_RXGETEVENTS %s",
-                          strerror(errno) );
+                msg_Warn( p_demux, "couldn't SDIVIDEO_IOC_RXGETEVENTS %m" );
             else
             {
                 if ( i_val & SDIVIDEO_EVENT_RX_BUFFER )
@@ -725,8 +724,7 @@ static int InitCapture( demux_t *p_demux )
     if ( ioctl( p_sys->i_vfd, SDIVIDEO_IOC_RXGETVIDSTATUS, &p_sys->i_standard )
           < 0 )
     {
-        msg_Warn( p_demux, "couldn't SDIVIDEO_IOC_RXGETVIDSTATUS %s",
-                  strerror(errno) );
+        msg_Warn( p_demux, "couldn't SDIVIDEO_IOC_RXGETVIDSTATUS %m" );
         close( p_sys->i_vfd );
         return VLC_EGENERIC;
     }
@@ -752,8 +750,7 @@ static int InitCapture( demux_t *p_demux )
 
         if ( ioctl( p_sys->i_afd, SDIAUDIO_IOC_RXGETAUDRATE, &i_rate ) < 0 )
         {
-            msg_Warn( p_demux, "couldn't SDIAUDIO_IOC_RXGETAUDRATE %s",
-                      strerror(errno) );
+            msg_Warn( p_demux, "couldn't SDIAUDIO_IOC_RXGETAUDRATE %m" );
             return VLC_EGENERIC;
         }
         switch ( i_rate )
@@ -841,7 +838,7 @@ static int InitCapture( demux_t *p_demux )
                                                 PROT_READ, MAP_SHARED, p_sys->i_afd,
                                                 i * i_bufmemsize )) == MAP_FAILED )
             {
-                msg_Err( p_demux, "couldn't mmap(%d): %s", i, strerror(errno) );
+                msg_Err( p_demux, "couldn't mmap(%d): %m", i );
                 return VLC_EGENERIC;
             }
         }
@@ -895,7 +892,7 @@ static int InitCapture( demux_t *p_demux )
                                             PROT_READ, MAP_SHARED, p_sys->i_vfd,
                                             i * i_bufmemsize )) == MAP_FAILED )
         {
-            msg_Err( p_demux, "couldn't mmap(%d): %s", i, strerror(errno) );
+            msg_Err( p_demux, "couldn't mmap(%d): %m", i );
             return VLC_EGENERIC;
         }
     }
@@ -941,7 +938,7 @@ static int Capture( demux_t *p_demux )
 
     if ( poll( pfd, 1 + (p_sys->i_max_channel != -1), READ_TIMEOUT ) < 0 )
     {
-        msg_Warn( p_demux, "couldn't poll(): %s", strerror(errno) );
+        msg_Warn( p_demux, "couldn't poll(): %m" );
         return VLC_EGENERIC;
     }
 
@@ -950,8 +947,7 @@ static int Capture( demux_t *p_demux )
         unsigned int i_val;
 
         if ( ioctl( p_sys->i_vfd, SDIVIDEO_IOC_RXGETEVENTS, &i_val ) < 0 )
-            msg_Warn( p_demux, "couldn't SDIVIDEO_IOC_RXGETEVENTS %s",
-                      strerror(errno) );
+            msg_Warn( p_demux, "couldn't SDIVIDEO_IOC_RXGETEVENTS %m" );
         else
         {
             if ( i_val & SDIVIDEO_EVENT_RX_BUFFER )
@@ -975,8 +971,7 @@ static int Capture( demux_t *p_demux )
         unsigned int i_val;
 
         if ( ioctl( p_sys->i_afd, SDIAUDIO_IOC_RXGETEVENTS, &i_val ) < 0 )
-            msg_Warn( p_demux, "couldn't SDIAUDIO_IOC_RXGETEVENTS %s",
-                      strerror(errno) );
+            msg_Warn( p_demux, "couldn't SDIAUDIO_IOC_RXGETEVENTS %m" );
         else
         {
             if ( i_val & SDIAUDIO_EVENT_RX_BUFFER )
@@ -999,8 +994,7 @@ static int Capture( demux_t *p_demux )
         if ( ioctl( p_sys->i_vfd, SDIVIDEO_IOC_DQBUF, p_sys->i_current_vbuffer )
               < 0 )
         {
-            msg_Warn( p_demux, "couldn't SDIVIDEO_IOC_DQBUF %s",
-                      strerror(errno) );
+            msg_Warn( p_demux, "couldn't SDIVIDEO_IOC_DQBUF %m" );
             return VLC_EGENERIC;
         }
 
@@ -1010,8 +1004,7 @@ static int Capture( demux_t *p_demux )
         if ( ioctl( p_sys->i_vfd, SDIVIDEO_IOC_QBUF, p_sys->i_current_vbuffer )
               < 0 )
         {
-            msg_Warn( p_demux, "couldn't SDIVIDEO_IOC_QBUF %s",
-                      strerror(errno) );
+            msg_Warn( p_demux, "couldn't SDIVIDEO_IOC_QBUF %m" );
             return VLC_EGENERIC;
         }
 
@@ -1024,7 +1017,7 @@ static int Capture( demux_t *p_demux )
 
         if ( read( p_sys->i_vfd, p_buffer, p_sys->i_vbuffer_size ) < 0 )
         {
-            msg_Warn( p_demux, "couldn't read %s", strerror(errno) );
+            msg_Warn( p_demux, "couldn't read %m" );
             free( p_buffer );
             return VLC_EGENERIC;
         }
@@ -1044,8 +1037,7 @@ static int Capture( demux_t *p_demux )
         if ( ioctl( p_sys->i_afd, SDIAUDIO_IOC_DQBUF, p_sys->i_current_abuffer )
               < 0 )
         {
-            msg_Warn( p_demux, "couldn't SDIAUDIO_IOC_DQBUF %s",
-                      strerror(errno) );
+            msg_Warn( p_demux, "couldn't SDIAUDIO_IOC_DQBUF %m" );
             return VLC_EGENERIC;
         }
 
@@ -1055,8 +1047,7 @@ static int Capture( demux_t *p_demux )
         if ( ioctl( p_sys->i_afd, SDIAUDIO_IOC_QBUF, p_sys->i_current_abuffer )
               < 0 )
         {
-            msg_Warn( p_demux, "couldn't SDIAUDIO_IOC_QBUF %s",
-                      strerror(errno) );
+            msg_Warn( p_demux, "couldn't SDIAUDIO_IOC_QBUF %m" );
             return VLC_EGENERIC;
         }
 
@@ -1069,7 +1060,7 @@ static int Capture( demux_t *p_demux )
 
         if ( read( p_sys->i_afd, p_buffer, p_sys->i_abuffer_size ) < 0 )
         {
-            msg_Warn( p_demux, "couldn't read %s", strerror(errno) );
+            msg_Warn( p_demux, "couldn't read %m" );
             free( p_buffer );
             return VLC_EGENERIC;
         }
diff --git a/modules/access/linsys/linsys_sdi.c b/modules/access/linsys/linsys_sdi.c
index 4a14c5b..626446f 100644
--- a/modules/access/linsys/linsys_sdi.c
+++ b/modules/access/linsys/linsys_sdi.c
@@ -1768,7 +1768,7 @@ static int InitCapture( demux_t *p_demux )
                                            PROT_READ, MAP_SHARED, p_sys->i_fd,
                                            i * i_bufmemsize )) == MAP_FAILED )
         {
-            msg_Err( p_demux, "couldn't mmap(%d): %s", i, strerror(errno) );
+            msg_Err( p_demux, "couldn't mmap(%d): %m", i );
             free( p_sys->pp_buffers );
             return VLC_EGENERIC;
         }
@@ -1798,7 +1798,7 @@ static int Capture( demux_t *p_demux )
 
     if ( poll( &pfd, 1, READ_TIMEOUT ) < 0 )
     {
-        msg_Warn( p_demux, "couldn't poll(): %s", strerror(errno) );
+        msg_Warn( p_demux, "couldn't poll(): %m" );
         return VLC_EGENERIC;
     }
 
@@ -1807,7 +1807,7 @@ static int Capture( demux_t *p_demux )
         unsigned int i_val;
 
         if ( ioctl( p_sys->i_fd, SDI_IOC_RXGETEVENTS, &i_val ) < 0 )
-            msg_Warn( p_demux, "couldn't SDI_IOC_RXGETEVENTS %s", strerror(errno) );
+            msg_Warn( p_demux, "couldn't SDI_IOC_RXGETEVENTS %m" );
         else
         {
             if ( i_val & SDI_EVENT_RX_BUFFER )
@@ -1827,7 +1827,7 @@ static int Capture( demux_t *p_demux )
 
         if ( ioctl( p_sys->i_fd, SDI_IOC_DQBUF, p_sys->i_current_buffer ) < 0 )
         {
-            msg_Warn( p_demux, "couldn't SDI_IOC_DQBUF %s", strerror(errno) );
+            msg_Warn( p_demux, "couldn't SDI_IOC_DQBUF %m" );
             return VLC_EGENERIC;
         }
 
@@ -1837,7 +1837,7 @@ static int Capture( demux_t *p_demux )
 
         if ( ioctl( p_sys->i_fd, SDI_IOC_QBUF, p_sys->i_current_buffer ) < 0 )
         {
-            msg_Warn( p_demux, "couldn't SDI_IOC_QBUF %s", strerror(errno) );
+            msg_Warn( p_demux, "couldn't SDI_IOC_QBUF %m" );
             return VLC_EGENERIC;
         }
 



More information about the vlc-commits mailing list