]> git.sesse.net Git - vlc/commitdiff
Replace strerror() with %m (or Linux DVB: strerror_r) - refs #1297
authorRémi Denis-Courmont <rem@videolan.org>
Tue, 18 Sep 2007 16:20:49 +0000 (16:20 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Tue, 18 Sep 2007 16:20:49 +0000 (16:20 +0000)
34 files changed:
modules/access/directory.c
modules/access/dv.c
modules/access/dvb/access.c
modules/access/dvb/en50221.c
modules/access/dvb/linux_dvb.c
modules/access/file.c
modules/access/mms/mmstu.c
modules/access/pvr.c
modules/access/smb.c
modules/access/v4l.c
modules/access/v4l2.c
modules/access_filter/dump.c
modules/access_filter/record.c
modules/access_filter/timeshift.c
modules/access_output/file.c
modules/access_output/udp.c
modules/audio_output/alsa.c
modules/audio_output/esd.c
modules/audio_output/file.c
modules/audio_output/hd1000a.cpp
modules/audio_output/oss.c
modules/codec/subtitles/subsdec.c
modules/control/http/macro.c
modules/control/http/mvar.c
modules/control/http/util.c
modules/control/rc.c
modules/gui/ncurses.c
modules/gui/qnx/aout.c
modules/misc/freetype.c
modules/misc/gnutls.c
modules/misc/notify/growl.c
modules/stream_out/rtp.c
modules/video_output/fb.c
modules/video_output/x11/xcommon.c

index 14526c8fc0c6ae03813bfe5a86073a26cd22ab73..65c83cca0d87ff63b0742f9e069d1492abe86a83 100644 (file)
@@ -377,8 +377,7 @@ static int ReadDir( playlist_t *p_playlist, const char *psz_name,
 
     if ((fd == -1) || fstat (fd, &stself.st))
     {
-        msg_Err (p_playlist, "cannot stat `%s': %s", psz_name,
-                 strerror (errno));
+        msg_Err (p_playlist, "cannot stat `%s': %m", psz_name);
         return VLC_EGENERIC;
     }
 
@@ -405,8 +404,7 @@ static int ReadDir( playlist_t *p_playlist, const char *psz_name,
     i_dir_content = utf8_loaddir (handle, &pp_dir_content, NULL, Sort);
     if( i_dir_content == -1 )
     {
-        msg_Err (p_playlist, "cannot read `%s': %s", psz_name,
-                 strerror (errno));
+        msg_Err (p_playlist, "cannot read `%s': %m", psz_name);
         return VLC_EGENERIC;
     }
     else if( i_dir_content <= 0 )
@@ -551,7 +549,7 @@ static DIR *OpenDir (vlc_object_t *obj, const char *path)
     {
         int err = errno;
         if (err != ENOTDIR)
-            msg_Err (obj, "%s: %s", path, strerror (err));
+            msg_Err (obj, "%s: %m", path);
         else
             msg_Dbg (obj, "skipping non-directory `%s'", path);
         errno = err;
index 3f94f8d839256cf06032470195db9e8e65f1f4e1..92bdc251f956171e6a2e61e047c49a599d4d20b3 100644 (file)
@@ -469,13 +469,13 @@ static int Raw1394GetNumPorts( access_t *p_access )
     /* get a raw1394 handle */
     if ( !( handle = raw1394_new_handle() ) )
     {
-        msg_Err( p_access, "raw1394 - failed to get handle: %s.\n", strerror( errno ) );
+        msg_Err( p_access, "raw1394 - failed to get handle: %m." );
         return VLC_EGENERIC;
     }
 
     if ( ( n_ports = raw1394_get_port_info( handle, pinf, 16 ) ) < 0 )
     {
-        msg_Err( p_access, "raw1394 - failed to get port info: %s.\n", strerror( errno ) );
+        msg_Err( p_access, "raw1394 - failed to get port info: %m.\n" );
         raw1394_destroy_handle( handle );
         return VLC_EGENERIC;
     }
@@ -501,13 +501,13 @@ static raw1394handle_t Raw1394Open( access_t *p_access, int port )
 
     if ( !handle )
     {
-        msg_Err( p_access, "raw1394 - failed to get handle: %s.\n", strerror( errno ) );
+        msg_Err( p_access, "raw1394 - failed to get handle: %m." );
         return NULL;
     }
 
     if ( ( n_ports = raw1394_get_port_info( handle, pinf, 16 ) ) < 0 )
     {
-        msg_Err( p_access, "raw1394 - failed to get port info: %s.\n", strerror( errno ) );
+        msg_Err( p_access, "raw1394 - failed to get port info: %m." );
         raw1394_destroy_handle( handle );
         return NULL;
     }
@@ -515,7 +515,7 @@ static raw1394handle_t Raw1394Open( access_t *p_access, int port )
     /* tell raw1394 which host adapter to use */
     if ( raw1394_set_port( handle, port ) < 0 )
     {
-        msg_Err( p_access, "raw1394 - failed to set set port: %s.\n", strerror( errno ) );
+        msg_Err( p_access, "raw1394 - failed to set set port: %m." );
         return NULL;
     }
 
index d08a7a2dedfd530eca44e4af136b0076acc245d9..47fa4ba42d6496c2678dc9cc6a4056614047053c 100644 (file)
@@ -433,7 +433,7 @@ static block_t *Block( access_t *p_access )
             if( errno == EINTR )
                 continue;
 
-            msg_Err( p_access, "poll error: %s", strerror(errno) );
+            msg_Err( p_access, "poll error: %m" );
             return NULL;
         }
 
@@ -492,7 +492,7 @@ static block_t *Block( access_t *p_access )
             if( ( p_block->i_buffer = read( p_sys->i_handle, p_block->p_buffer,
                                 p_sys->i_read_once * TS_PACKET_SIZE ) ) <= 0 )
             {
-                msg_Warn( p_access, "read failed (%s)", strerror(errno) );
+                msg_Warn( p_access, "read failed (%m)" );
                 block_Release( p_block );
                 continue;
             }
index 809a085efbd62e03bd89bb74504ecdbb3dfa9db8..153295bcccd46f9b029195a1767156bce968797a 100644 (file)
@@ -230,8 +230,7 @@ static int TPDUSend( access_t * p_access, uint8_t i_slot, uint8_t i_tag,
 
     if ( write( p_sys->i_ca_handle, p_data, i_size ) != i_size )
     {
-        msg_Err( p_access, "cannot write to CAM device (%s)",
-                 strerror(errno) );
+        msg_Err( p_access, "cannot write to CAM device (%m)" );
         return VLC_EGENERIC;
     }
 
@@ -275,8 +274,7 @@ static int TPDURecv( access_t * p_access, uint8_t i_slot, uint8_t *pi_tag,
 
     if ( i_size < 5 )
     {
-        msg_Err( p_access, "cannot read from CAM device (%d:%s)", i_size,
-                 strerror(errno) );
+        msg_Err( p_access, "cannot read from CAM device (%d:%m)", i_size );
         return VLC_EGENERIC;
     }
 
@@ -815,7 +813,7 @@ static int APDUSend( access_t * p_access, int i_session_id, int i_tag,
             i_ret = ioctl(p_sys->i_ca_handle, CA_SEND_MSG, &ca_msg );
             if ( i_ret < 0 )
             {
-                msg_Err( p_access, "Error sending to CAM: %s", strerror(errno) );
+                msg_Err( p_access, "Error sending to CAM: %m" );
                 i_ret = VLC_EGENERIC;
             }
         }
index b98fd3a6f086761e1efd09f544504381ec0c38a7..b0f5c9df5e2099a626eeac9a5e8e71cb6ae48200 100644 (file)
@@ -110,8 +110,7 @@ int E_(FrontendOpen)( access_t *p_access )
     msg_Dbg( p_access, "Opening device %s", frontend );
     if( (p_sys->i_frontend_handle = open(frontend, O_RDWR | O_NONBLOCK)) < 0 )
     {
-        msg_Err( p_access, "FrontEndOpen: opening device failed (%s)",
-                 strerror(errno) );
+        msg_Err( p_access, "FrontEndOpen: opening device failed (%m)" );
         free( p_frontend );
         return VLC_EGENERIC;
     }
@@ -296,8 +295,8 @@ void E_(FrontendPoll)( access_t *p_access )
             if( errno == EWOULDBLOCK )
                 return; /* no more events */
 
-            msg_Err( p_access, "reading frontend event failed (%d) %s",
-                     i_ret, strerror(errno) );
+            msg_Err( p_access, "reading frontend event failed (%d): %m",
+                     i_ret );
             return;
         }
 
@@ -379,8 +378,9 @@ void E_(FrontendStatus)( access_t *p_access )
     if( (i_ret = ioctl( p_sys->i_frontend_handle, FE_GET_INFO,
                         &p_frontend->info )) < 0 )
     {
-        p += sprintf( p, "ioctl FE_GET_INFO failed (%d) %s\n", i_ret,
-                      strerror(errno) );
+        char buf[1000];
+        strerror_r( errno, buf, sizeof( buf ) );
+        p += sprintf( p, "ioctl FE_GET_INFO failed (%d) %s\n", i_ret, buf );
         goto out;
     }
 
@@ -466,8 +466,10 @@ void E_(FrontendStatus)( access_t *p_access )
     if( (i_ret = ioctl( p_sys->i_frontend_handle, FE_READ_STATUS, &i_status ))
            < 0 )
     {
-        p += sprintf( p, "</table>ioctl FE_READ_STATUS failed (%d) %s\n", i_ret,
-                      strerror(errno) );
+        char buf[1000];
+        strerror_r( errno, buf, sizeof( buf ) );
+        p += sprintf( p, "</table>ioctl FE_READ_STATUS failed (%d) %s\n",
+                      i_ret, buf );
         goto out;
     }
 
@@ -523,8 +525,7 @@ static int FrontendInfo( access_t *p_access )
     if( (i_ret = ioctl( p_sys->i_frontend_handle, FE_GET_INFO,
                         &p_frontend->info )) < 0 )
     {
-        msg_Err( p_access, "ioctl FE_GET_INFO failed (%d) %s", i_ret,
-                 strerror(errno) );
+        msg_Err( p_access, "ioctl FE_GET_INFO failed (%d): %m", i_ret );
         return VLC_EGENERIC;
     }
 
@@ -807,17 +808,16 @@ static int DoDiseqc( access_t *p_access )
     /* Switch off continuous tone. */
     if( (i_err = ioctl( p_sys->i_frontend_handle, FE_SET_TONE, SEC_TONE_OFF )) < 0 )
     {
-        msg_Err( p_access, "ioctl FE_SET_TONE failed, tone=%s (%d) %s",
-                 fe_tone == SEC_TONE_ON ? "on" : "off", i_err,
-                 strerror(errno) );
+        msg_Err( p_access, "ioctl FE_SET_TONE failed, tone=%s (%d) %m",
+                 fe_tone == SEC_TONE_ON ? "on" : "off", i_err );
         return i_err;
     }
 
     /* Configure LNB voltage. */
     if( (i_err = ioctl( p_sys->i_frontend_handle, FE_SET_VOLTAGE, fe_voltage )) < 0 )
     {
-        msg_Err( p_access, "ioctl FE_SET_VOLTAGE failed, voltage=%d (%d) %s",
-                 fe_voltage, i_err, strerror(errno) );
+        msg_Err( p_access, "ioctl FE_SET_VOLTAGE failed, voltage=%d (%d) %m",
+                 fe_voltage, i_err );
         return i_err;
     }
 
@@ -826,8 +826,8 @@ static int DoDiseqc( access_t *p_access )
                         val.b_bool )) < 0 && val.b_bool )
     {
         msg_Err( p_access,
-                 "ioctl FE_ENABLE_HIGH_LNB_VOLTAGE failed, val=%d (%d) %s",
-                 val.b_bool, i_err, strerror(errno) );
+                 "ioctl FE_ENABLE_HIGH_LNB_VOLTAGE failed, val=%d (%d) %m",
+                 val.b_bool, i_err );
     }
 
     /* Wait for at least 15 ms. */
@@ -854,8 +854,8 @@ static int DoDiseqc( access_t *p_access )
         if( (i_err = ioctl( p_sys->i_frontend_handle, FE_DISEQC_SEND_MASTER_CMD,
                            &cmd.cmd )) < 0 )
         {
-            msg_Err( p_access, "ioctl FE_SEND_MASTER_CMD failed (%d) %s",
-                     i_err, strerror(errno) );
+            msg_Err( p_access, "ioctl FE_SEND_MASTER_CMD failed (%d) %m",
+                     i_err );
             return i_err;
         }
 
@@ -865,8 +865,8 @@ static int DoDiseqc( access_t *p_access )
         if( (i_err = ioctl( p_sys->i_frontend_handle, FE_DISEQC_SEND_BURST,
                       ((val.i_int - 1) % 2) ? SEC_MINI_B : SEC_MINI_A )) < 0 )
         {
-            msg_Err( p_access, "ioctl FE_SEND_BURST failed (%d) %s",
-                     i_err, strerror(errno) );
+            msg_Err( p_access, "ioctl FE_SEND_BURST failed (%d) %m",
+                     i_err );
             return i_err;
         }
 
@@ -875,9 +875,8 @@ static int DoDiseqc( access_t *p_access )
 
     if( (i_err = ioctl( p_sys->i_frontend_handle, FE_SET_TONE, fe_tone )) < 0 )
     {
-        msg_Err( p_access, "ioctl FE_SET_TONE failed, tone=%s (%d) %s",
-                 fe_tone == SEC_TONE_ON ? "on" : "off", i_err,
-                 strerror(errno) );
+        msg_Err( p_access, "ioctl FE_SET_TONE failed, tone=%s (%d) %m",
+                 fe_tone == SEC_TONE_ON ? "on" : "off", i_err );
         return i_err;
     }
 
@@ -990,8 +989,7 @@ static int FrontendSetQPSK( access_t *p_access )
     /* Now send it all to the frontend device */
     if( (i_ret = ioctl( p_sys->i_frontend_handle, FE_SET_FRONTEND, &fep )) < 0 )
     {
-        msg_Err( p_access, "DVB-S: setting frontend failed (%d) %s", i_ret,
-                 strerror(errno) );
+        msg_Err( p_access, "DVB-S: setting frontend failed (%d) %m", i_ret );
         return VLC_EGENERIC;
     }
 
@@ -1035,8 +1033,7 @@ static int FrontendSetQAM( access_t *p_access )
     /* Now send it all to the frontend device */
     if( (i_ret = ioctl( p_sys->i_frontend_handle, FE_SET_FRONTEND, &fep )) < 0 )
     {
-        msg_Err( p_access, "DVB-C: setting frontend failed (%d) %s", i_ret,
-                 strerror(errno) );
+        msg_Err( p_access, "DVB-C: setting frontend failed (%d): %m", i_ret );
         return VLC_EGENERIC;
     }
 
@@ -1171,8 +1168,7 @@ static int FrontendSetOFDM( access_t * p_access )
     /* Now send it all to the frontend device */
     if( (ret = ioctl( p_sys->i_frontend_handle, FE_SET_FRONTEND, &fep )) < 0 )
     {
-        msg_Err( p_access, "DVB-T: setting frontend failed (%d) %s", ret,
-                 strerror(errno) );
+        msg_Err( p_access, "DVB-T: setting frontend failed (%d): %s", ret );
         return -1;
     }
 
@@ -1208,8 +1204,7 @@ static int FrontendSetATSC( access_t *p_access )
     /* Now send it all to the frontend device */
     if( (i_ret = ioctl( p_sys->i_frontend_handle, FE_SET_FRONTEND, &fep )) < 0 )
     {
-        msg_Err( p_access, "ATSC: setting frontend failed (%d) %s", i_ret,
-                 strerror(errno) );
+        msg_Err( p_access, "ATSC: setting frontend failed (%d): %s", i_ret );
         return VLC_EGENERIC;
     }
 
@@ -1247,8 +1242,7 @@ int E_(DMXSetFilter)( access_t * p_access, int i_pid, int * pi_fd, int i_type )
     msg_Dbg( p_access, "Opening device %s", dmx );
     if( (*pi_fd = open(dmx, O_RDWR)) < 0 )
     {
-        msg_Err( p_access, "DMXSetFilter: opening device failed (%s)",
-                 strerror(errno) );
+        msg_Err( p_access, "DMXSetFilter: opening device failed (%m)" );
         return VLC_EGENERIC;
     }
 
@@ -1354,8 +1348,7 @@ int E_(DMXSetFilter)( access_t * p_access, int i_pid, int * pi_fd, int i_type )
     /* We then give the order to the device : */
     if( (i_ret = ioctl( *pi_fd, DMX_SET_PES_FILTER, &s_filter_params )) < 0 )
     {
-        msg_Err( p_access, "DMXSetFilter: failed with %d (%s)", i_ret,
-                 strerror(errno) );
+        msg_Err( p_access, "DMXSetFilter: failed with %d (%m)", i_ret );
         return VLC_EGENERIC;
     }
     return VLC_SUCCESS;
@@ -1370,8 +1363,7 @@ int E_(DMXUnsetFilter)( access_t * p_access, int i_fd )
 
     if( (i_ret = ioctl( i_fd, DMX_STOP )) < 0 )
     {
-        msg_Err( p_access, "DMX_STOP failed for demux (%d) %s",
-                 i_ret, strerror(errno) );
+        msg_Err( p_access, "DMX_STOP failed for demux (%d): %m", i_ret );
         return i_ret;
     }
 
@@ -1410,15 +1402,13 @@ int E_(DVROpen)( access_t * p_access )
     msg_Dbg( p_access, "Opening device %s", dvr );
     if( (p_sys->i_handle = open(dvr, O_RDONLY)) < 0 )
     {
-        msg_Err( p_access, "DVROpen: opening device failed (%s)",
-                 strerror(errno) );
+        msg_Err( p_access, "DVROpen: opening device failed (%m)" );
         return VLC_EGENERIC;
     }
 
     if( fcntl( p_sys->i_handle, F_SETFL, O_NONBLOCK ) == -1 )
     {
-        msg_Warn( p_access, "DVROpen: couldn't set non-blocking mode (%s)",
-                  strerror(errno) );
+        msg_Warn( p_access, "DVROpen: couldn't set non-blocking mode (%m)" );
     }
 
     return VLC_SUCCESS;
@@ -1462,8 +1452,7 @@ int E_(CAMOpen)( access_t *p_access )
     msg_Dbg( p_access, "Opening device %s", ca );
     if( (p_sys->i_ca_handle = open(ca, O_RDWR | O_NONBLOCK)) < 0 )
     {
-        msg_Warn( p_access, "CAMInit: opening CAM device failed (%s)",
-                  strerror(errno) );
+        msg_Warn( p_access, "CAMInit: opening CAM device failed (%m)" );
         p_sys->i_ca_handle = 0;
         return VLC_EGENERIC;
     }
@@ -1686,8 +1675,9 @@ void E_(CAMStatus)( access_t * p_access )
 
     if ( ioctl( p_sys->i_ca_handle, CA_GET_CAP, &caps ) != 0 )
     {
-        p += sprintf( p, "ioctl CA_GET_CAP failed (%s)\n",
-                      strerror(errno) );
+        char buf[1000];
+        strerror_r( errno, buf, sizeof( buf ) );
+        p += sprintf( p, "ioctl CA_GET_CAP failed (%s)\n", buf );
         goto out;
     }
 
@@ -1728,8 +1718,9 @@ void E_(CAMStatus)( access_t * p_access )
         sinfo.num = i_slot;
         if ( ioctl( p_sys->i_ca_handle, CA_GET_SLOT_INFO, &sinfo ) != 0 )
         {
-            p += sprintf( p, "ioctl CA_GET_SLOT_INFO failed (%s)<br>\n",
-                          strerror(errno) );
+            char buf[1000];
+            strerror_r( errno, buf, sizeof( buf ) );
+            p += sprintf( p, "ioctl CA_GET_SLOT_INFO failed (%s)<br>\n", buf );
             continue;
         }
 
index 01aa0e28a177ff2b2123070c07c1a0b3842d252b..bcdf0a732f51e4e905acfa11fc4ba4f695445eee 100644 (file)
@@ -168,7 +168,7 @@ static int Open( vlc_object_t *p_this )
     while (fd != -1)
     {
         if (fstat (fd, &st))
-            msg_Err (p_access, "fstat(%d): %s", fd, strerror (errno));
+            msg_Err (p_access, "fstat(%d): %m", fd);
         else
         if (S_ISDIR (st.st_mode))
             /* The directory plugin takes care of that */
@@ -277,7 +277,8 @@ static int Read( access_t *p_access, uint8_t *p_buffer, int i_len )
                 break;
 
             default:
-                msg_Err (p_access, "read failed (%s)", strerror (errno));
+                msg_Err (p_access, "read failed (%m)");
+                /* FIXME: DO NOT USE strerror!!!! */
                 intf_UserFatal (p_access, VLC_FALSE, _("File reading failed"),
                                 _("VLC could not read file \"%s\"."),
                                 strerror (errno));
@@ -445,8 +446,7 @@ static int open_file (access_t *p_access, const char *psz_name)
     free (path);
     if (fd == -1)
     {
-        msg_Err (p_access, "cannot open file %s (%s)", psz_name,
-                 strerror (errno));
+        msg_Err (p_access, "cannot open file %s (%m)", psz_name);
         intf_UserFatal (p_access, VLC_FALSE, _("File reading failed"),
                         _("VLC could not open file \"%s\" (%s)."),
                         psz_name, strerror (errno));
index 750aa520f49dc0ca65a12f535b5a4c5907d46b13..71c256047c1ab67902f57b566dc7301908049a87 100644 (file)
@@ -1042,7 +1042,7 @@ static int NetFillBuffer( access_t *p_access )
 
     if( i_ret < 0 )
     {
-        msg_Err( p_access, "network select error (%s)", strerror(errno) );
+        msg_Err( p_access, "network select error (%m)" );
         return -1;
     }
 
index e2596dd81d1b632f488b15d5b1d363cd28f56696..52c197ce6ee77b2bbe6965686af8bc8089d7b3a6 100644 (file)
@@ -831,7 +831,7 @@ static int Open( vlc_object_t * p_this )
     p_sys->i_fd = open( p_sys->psz_videodev, O_RDWR );
     if( p_sys->i_fd < 0 )
     {
-        msg_Err( p_access, "Cannot open device (%s).", strerror( errno ) );
+        msg_Err( p_access, "Cannot open device (%m)." );
         Close( VLC_OBJECT(p_access) );
         return VLC_EGENERIC;
     }
@@ -936,8 +936,7 @@ static int Open( vlc_object_t * p_this )
             p_sys->i_radio_fd = open( p_sys->psz_radiodev, O_RDWR );
             if( p_sys->i_radio_fd < 0 )
             {
-                msg_Err( p_access, "Cannot open radio device (%s).",
-                         strerror( errno ) );
+                msg_Err( p_access, "Cannot open radio device (%m)." );
                 Close( VLC_OBJECT(p_access) );
                 return VLC_EGENERIC;
             }
@@ -954,8 +953,7 @@ static int Open( vlc_object_t * p_this )
         result = ioctl( i_fd, VIDIOC_G_TUNER, &vt );
         if ( result < 0 )
         {
-            msg_Warn( p_access, "Failed to read tuner information (%s).",
-                      strerror( errno ) );
+            msg_Warn( p_access, "Failed to read tuner information (%m)." );
         }
         else
         {
@@ -967,8 +965,7 @@ static int Open( vlc_object_t * p_this )
             result = ioctl( i_fd, VIDIOC_G_FREQUENCY, &vf );
             if ( result < 0 )
             {
-                msg_Warn( p_access, "Failed to read tuner frequency (%s).",
-                          strerror( errno ) );
+                msg_Warn( p_access, "Failed to read tuner frequency (%m)." );
             }
             else
             {
@@ -980,8 +977,7 @@ static int Open( vlc_object_t * p_this )
                 result = ioctl( i_fd, VIDIOC_S_FREQUENCY, &vf );
                 if( result < 0 )
                 {
-                    msg_Warn( p_access, "Failed to set tuner frequency (%s).",
-                              strerror( errno ) );
+                    msg_Warn( p_access, "Failed to set tuner frequency (%m)." );
                 }
                 else
                 {
@@ -1090,7 +1086,7 @@ static int Read( access_t * p_access, uint8_t * p_buffer, int i_len )
 
     if( i_ret < 0 )
     {
-        msg_Err( p_access, "Select error (%s).", strerror( errno ) );
+        msg_Err( p_access, "Polling error (%m)." );
         return -1;
     }
 
index b7672a9ca6dc3fc1388e3983529f0b6a9a366115..c192f2a9fe00cc36721ca23bad9046367aead113 100644 (file)
@@ -220,7 +220,7 @@ static int Open( vlc_object_t *p_this )
 
     if( !smbc_init_context( p_smb ) )
     {
-        msg_Err( p_access, "cannot initialize context (%s)", strerror(errno) );
+        msg_Err( p_access, "cannot initialize context (%m)" );
         smbc_free_context( p_smb, 1 );
         free( psz_uri );
         return VLC_EGENERIC;
@@ -228,8 +228,8 @@ static int Open( vlc_object_t *p_this )
 
     if( !(p_file = (p_smb->open)( p_smb, psz_uri, O_RDONLY, 0 )) )
     {
-        msg_Err( p_access, "open failed for '%s' (%s)",
-                 p_access->psz_path, strerror(errno) );
+        msg_Err( p_access, "open failed for '%s' (%m)",
+                 p_access->psz_path );
         smbc_free_context( p_smb, 1 );
         free( psz_uri );
         return VLC_EGENERIC;
@@ -239,7 +239,7 @@ static int Open( vlc_object_t *p_this )
     STANDARD_READ_ACCESS_INIT;
 
     i_ret = p_smb->fstat( p_smb, p_file, &filestat );
-    if( i_ret ) msg_Err( p_access, "stat failed (%s)", strerror(errno) );
+    if( i_ret ) msg_Err( p_access, "stat failed (%m)" );
     else p_access->info.i_size = filestat.st_size;
 #else
 
@@ -261,8 +261,8 @@ static int Open( vlc_object_t *p_this )
 #endif
     if( (i_smb = smbc_open( psz_uri, O_RDONLY, 0 )) < 0 )
     {
-        msg_Err( p_access, "open failed for '%s' (%s)",
-                 p_access->psz_path, strerror(errno) );
+        msg_Err( p_access, "open failed for '%s' (%m)",
+                 p_access->psz_path );
         free( psz_uri );
         return VLC_EGENERIC;
     }
@@ -271,7 +271,11 @@ static int Open( vlc_object_t *p_this )
     STANDARD_READ_ACCESS_INIT;
 
     i_ret = smbc_fstat( i_smb, &filestat );
-    if( i_ret ) msg_Err( p_access, "stat failed (%s)", strerror(i_ret) );
+    if( i_ret )
+    {
+        errno = i_ret;
+        msg_Err( p_access, "stat failed (%m)" );
+    }
     else p_access->info.i_size = filestat.st_size;
 #endif
 
@@ -331,7 +335,7 @@ static int Seek( access_t *p_access, int64_t i_pos )
 #endif
     if( i_ret == -1 )
     {
-        msg_Err( p_access, "seek failed (%s)", strerror(errno) );
+        msg_Err( p_access, "seek failed (%m)" );
         return VLC_EGENERIC;
     }
 
@@ -358,7 +362,7 @@ static int Read( access_t *p_access, uint8_t *p_buffer, int i_len )
 #endif
     if( i_read < 0 )
     {
-        msg_Err( p_access, "read failed (%s)", strerror(errno) );
+        msg_Err( p_access, "read failed (%m)" );
         return -1;
     }
 
index c61bd0a59eb23dca24aea1198ef7cefc2acc48d6..f9e534cf70c3391c966d9d1f152b407db1a25969 100644 (file)
@@ -878,13 +878,13 @@ static int OpenVideoDev( demux_t *p_demux, char *psz_device )
 
     if( ( i_fd = open( psz_device, O_RDWR ) ) < 0 )
     {
-        msg_Err( p_demux, "cannot open device (%s)", strerror( errno ) );
+        msg_Err( p_demux, "cannot open device (%m)" );
         goto vdev_failed;
     }
 
     if( ioctl( i_fd, VIDIOCGCAP, &p_sys->vid_cap ) < 0 )
     {
-        msg_Err( p_demux, "cannot get capabilities (%s)", strerror( errno ) );
+        msg_Err( p_demux, "cannot get capabilities (%m)" );
         goto vdev_failed;
     }
 
@@ -929,8 +929,7 @@ static int OpenVideoDev( demux_t *p_demux, char *psz_device )
     vid_channel.channel = p_sys->i_channel;
     if( ioctl( i_fd, VIDIOCGCHAN, &vid_channel ) < 0 )
     {
-        msg_Err( p_demux, "cannot get channel infos (%s)",
-                          strerror( errno ) );
+        msg_Err( p_demux, "cannot get channel infos (%m)" );
         goto vdev_failed;
     }
     msg_Dbg( p_demux,
@@ -947,7 +946,7 @@ static int OpenVideoDev( demux_t *p_demux, char *psz_device )
     vid_channel.norm = p_sys->i_norm;
     if( ioctl( i_fd, VIDIOCSCHAN, &vid_channel ) < 0 )
     {
-        msg_Err( p_demux, "cannot set channel (%s)", strerror( errno ) );
+        msg_Err( p_demux, "cannot set channel (%m)" );
         goto vdev_failed;
     }
 
@@ -962,7 +961,7 @@ static int OpenVideoDev( demux_t *p_demux, char *psz_device )
             vid_tuner.tuner = p_sys->i_tuner;
             if( ioctl( i_fd, VIDIOCGTUNER, &vid_tuner ) < 0 )
             {
-                msg_Err( p_demux, "cannot get tuner (%s)", strerror( errno ) );
+                msg_Err( p_demux, "cannot get tuner (%m)" );
                 goto vdev_failed;
             }
             msg_Dbg( p_demux, "tuner %s low=%d high=%d, flags=0x%x "
@@ -977,7 +976,7 @@ static int OpenVideoDev( demux_t *p_demux, char *psz_device )
             //vid_tuner.mode = p_sys->i_norm;
             if( ioctl( i_fd, VIDIOCSTUNER, &vid_tuner ) < 0 )
             {
-                msg_Err( p_demux, "cannot set tuner (%s)", strerror( errno ) );
+                msg_Err( p_demux, "cannot set tuner (%m)" );
                 goto vdev_failed;
             }
         }
@@ -993,8 +992,7 @@ static int OpenVideoDev( demux_t *p_demux, char *psz_device )
             int driver_frequency = p_sys->i_frequency * 16 /1000;
             if( ioctl( i_fd, VIDIOCSFREQ, &driver_frequency ) < 0 )
             {
-                msg_Err( p_demux, "cannot set frequency (%s)",
-                                  strerror( errno ) );
+                msg_Err( p_demux, "cannot set frequency (%m)" );
                 goto vdev_failed;
             }
             msg_Dbg( p_demux, "frequency %d (%d)", p_sys->i_frequency,
@@ -1013,7 +1011,7 @@ static int OpenVideoDev( demux_t *p_demux, char *psz_device )
             vid_audio.audio = p_sys->i_audio;
             if( ioctl( i_fd, VIDIOCGAUDIO, &vid_audio ) < 0 )
             {
-                msg_Err( p_demux, "cannot get audio (%s)", strerror( errno ) );
+                msg_Err( p_demux, "cannot get audio (%m)" );
                 goto vdev_failed;
             }
 
@@ -1022,7 +1020,7 @@ static int OpenVideoDev( demux_t *p_demux, char *psz_device )
 
             if( ioctl( i_fd, VIDIOCSAUDIO, &vid_audio ) < 0 )
             {
-                msg_Err( p_demux, "cannot set audio (%s)", strerror( errno ) );
+                msg_Err( p_demux, "cannot set audio (%m)" );
                 goto vdev_failed;
             }
         }
@@ -1038,8 +1036,7 @@ static int OpenVideoDev( demux_t *p_demux, char *psz_device )
 
         if( ioctl( i_fd, MJPIOC_G_PARAMS, &mjpeg ) < 0 )
         {
-            msg_Err( p_demux, "cannot get mjpeg params (%s)",
-                              strerror( errno ) );
+            msg_Err( p_demux, "cannot get mjpeg params (%m)" );
             goto vdev_failed;
         }
         mjpeg.input = p_sys->i_channel;
@@ -1089,8 +1086,7 @@ static int OpenVideoDev( demux_t *p_demux, char *psz_device )
 
         if( ioctl( i_fd, MJPIOC_S_PARAMS, &mjpeg ) < 0 )
         {
-            msg_Err( p_demux, "cannot set mjpeg params (%s)",
-                              strerror( errno ) );
+            msg_Err( p_demux, "cannot set mjpeg params (%m)" );
             goto vdev_failed;
         }
 
@@ -1106,7 +1102,7 @@ static int OpenVideoDev( demux_t *p_demux, char *psz_device )
 
         if( ioctl( i_fd, VIDIOCGWIN, &vid_win ) < 0 )
         {
-            msg_Err( p_demux, "cannot get win (%s)", strerror( errno ) );
+            msg_Err( p_demux, "cannot get win (%m)" );
             goto vdev_failed;
         }
         p_sys->i_width  = vid_win.width;
@@ -1336,7 +1332,7 @@ static int OpenAudioDev( demux_t *p_demux, char *psz_device )
 
     if( (i_fd = open( psz_device, O_RDONLY | O_NONBLOCK )) < 0 )
     {
-        msg_Err( p_demux, "cannot open audio device (%s)", strerror( errno ) );
+        msg_Err( p_demux, "cannot open audio device (%m)" );
         goto adev_fail;
     }
 
@@ -1345,23 +1341,21 @@ static int OpenAudioDev( demux_t *p_demux, char *psz_device )
         || i_format != AFMT_S16_LE )
     {
         msg_Err( p_demux, "cannot set audio format (16b little endian) "
-                 "(%s)", strerror( errno ) );
+                 "(%m)" );
         goto adev_fail;
     }
 
     if( ioctl( i_fd, SNDCTL_DSP_STEREO,
                &p_sys->b_stereo ) < 0 )
     {
-        msg_Err( p_demux, "cannot set audio channels count (%s)",
-                 strerror( errno ) );
+        msg_Err( p_demux, "cannot set audio channels count (%m)" );
         goto adev_fail;
     }
 
     if( ioctl( i_fd, SNDCTL_DSP_SPEED,
                &p_sys->i_sample_rate ) < 0 )
     {
-        msg_Err( p_demux, "cannot set audio sample rate (%s)",
-                 strerror( errno ) );
+        msg_Err( p_demux, "cannot set audio sample rate (%m)" );
         goto adev_fail;
     }
 
index c6584f88590c02383f8f377ac14e4c6ed016e62c..d43956d1bedf12f6b4a1d68305d6f1e594ed1743 100644 (file)
@@ -188,7 +188,7 @@ int OpenVideoDev( demux_t *p_demux )
 
     if( ( i_fd = open( p_sys->psz_device, O_RDWR ) ) < 0 )
     {
-        msg_Err( p_demux, "cannot open device (%s)", strerror( errno ) );
+        msg_Err( p_demux, "cannot open device (%m)" );
         goto open_failed;
     }
 
@@ -203,7 +203,7 @@ int OpenVideoDev( demux_t *p_demux )
 
     if( ioctl( i_fd, VIDIOC_S_INPUT, &p_sys->i_selected_input ) < 0 )
     {
-       msg_Err( p_demux, "cannot set input (%s)", strerror( errno ) );
+       msg_Err( p_demux, "cannot set input (%m)" );
        goto open_failed;
     }
 
@@ -217,8 +217,8 @@ int OpenVideoDev( demux_t *p_demux )
 
         if( ioctl( i_fd, VIDIOC_REQBUFS, &reqbuf ) < 0 )
         {
-            msg_Err( p_demux, "cannot initiate I/O operation (%s). "
-                    "Only MMAP is supported at the moment", strerror( errno ) );
+            msg_Err( p_demux, "cannot initiate I/O operation (%m). "
+                    "Only MMAP is supported at the moment" );
             goto open_failed;
         }
         p_demux->pf_demux = DemuxMMAP;
@@ -250,7 +250,7 @@ int ProbeDev( demux_t *p_demux )
 
     if( ( i_fd = open( p_sys->psz_device, O_RDWR ) ) < 0 )
     {
-        msg_Err( p_demux, "cannot open device (%s)", strerror( errno ) );
+        msg_Err( p_demux, "cannot open device (%m)" );
         goto open_failed;
     }
 
@@ -258,7 +258,7 @@ int ProbeDev( demux_t *p_demux )
 
     if( ioctl( i_fd, VIDIOC_QUERYCAP, &p_sys->dev_cap ) < 0 )
     {
-        msg_Err( p_demux, "cannot get capabilities (%s)", strerror( errno ) );
+        msg_Err( p_demux, "cannot get capabilities (%m)" );
         goto open_failed;
     }
 
@@ -305,8 +305,8 @@ int ProbeDev( demux_t *p_demux )
 
             if( ioctl( i_fd, VIDIOC_ENUMINPUT, &p_sys->p_inputs[i_index] ) )
             {
-                msg_Err( p_demux, "cannot get video input characteristics (%s)",
-                                                 strerror( errno ) );
+                msg_Err( p_demux,
+                         "cannot get video input characteristics (%m)" );
                 goto open_failed;
             }
             msg_Dbg( p_demux, "video input %i (%s) has type: %s",
@@ -334,8 +334,8 @@ int ProbeDev( demux_t *p_demux )
         {
             if( ioctl( i_fd, VIDIOC_G_AUDIO, &p_sys->p_audios[ p_sys->i_audio] ) < 0 )
             {
-                msg_Err( p_demux, "cannot get video input characteristics (%s)",
-                                                 strerror( errno ) );
+                msg_Err( p_demux,
+                         "cannot get video input characteristics (%m)" );
                 goto open_failed;
             }
 
@@ -371,8 +371,7 @@ int ProbeDev( demux_t *p_demux )
 
             if( ioctl( i_fd, VIDIOC_G_TUNER, &p_sys->p_tuners[i_index] ) )
             {
-                msg_Err( p_demux, "cannot get tuner characteristics (%s)",
-                                                 strerror( errno ) );
+                msg_Err( p_demux, "cannot get tuner characteristics (%m)" );
                 goto open_failed;
             }
             msg_Dbg( p_demux, "tuner %i (%s) has type: %s, "
@@ -421,7 +420,7 @@ int ProbeDev( demux_t *p_demux )
 
             if( ioctl( i_fd, VIDIOC_ENUM_FMT, &p_sys->p_codecs[i_index] ) < 0 )
             {
-                msg_Err( p_demux, "cannot get codec description (%s)", strerror( errno ) );
+                msg_Err( p_demux, "cannot get codec description (%m)" );
                 goto open_failed;
             }
 
index eede01a11fa7a8eec27725c6da1ff90a11ac6c42..22d2e8a60270f990ae26a35ce9f0dc043768bb6b 100644 (file)
@@ -111,7 +111,7 @@ static int Open (vlc_object_t *obj)
 
     if ((p_sys->stream = tmpfile ()) == NULL)
     {
-        msg_Err (access, "cannot create temporary file: %s", strerror (errno));
+        msg_Err (access, "cannot create temporary file: %m");
         free (p_sys);
         return VLC_EGENERIC;
     }
@@ -167,7 +167,7 @@ static void Dump (access_t *access, const uint8_t *buffer, size_t len)
     assert (len > 0);
     if (fwrite (buffer, len, 1, stream) != 1)
     {
-        msg_Err (access, "cannot write to file: %s", strerror (errno));
+        msg_Err (access, "cannot write to file: %m");
         goto error;
     }
 
@@ -294,8 +294,7 @@ static void Trigger (access_t *access)
     FILE *newstream = utf8_fopen (filename, "wb");
     if (newstream == NULL)
     {
-        msg_Err (access, "cannot create dump file \"%s\": %s", filename,
-                 strerror (errno));
+        msg_Err (access, "cannot create dump file \"%s\": %m", filename);
         return;
     }
 
@@ -311,8 +310,7 @@ static void Trigger (access_t *access)
         {
             if (ferror (oldstream))
             {
-                msg_Err (access, "cannot read temporary file: %s",
-                         strerror (errno));
+                msg_Err (access, "cannot read temporary file: %m");
                 break;
             }
 
@@ -325,7 +323,7 @@ static void Trigger (access_t *access)
 
         if (fwrite (buf, len, 1, newstream) != 1)
         {
-            msg_Err (access, "cannot write dump file: %s", strerror (errno));
+            msg_Err (access, "cannot write dump file: %m");
             break;
         }
     }
index fc465fac60ea086a4db2ebc0d8c6b3b0e5a9e7ef..f51dbbfdbc67bb765ea808e0c5615481443a8208 100644 (file)
@@ -447,8 +447,8 @@ static void Dump( access_t *p_access, uint8_t *p_buffer, int i_buffer )
         p_sys->f = utf8_fopen( p_sys->psz_file, "wb" );
         if( p_sys->f == NULL )
         {
-            msg_Err( p_access, "cannot open file '%s' (%s)",
-                     p_sys->psz_file, strerror(errno) );
+            msg_Err( p_access, "cannot open file '%s' (%m)",
+                     p_sys->psz_file );
             free( p_sys->psz_file );
             p_sys->psz_file = NULL;
             p_sys->b_dump = VLC_FALSE;
index 49c49a353dfd1d29b0316c6ece8a9dc691125838..fd141c816851cb424c467ca94b18a484215c44fb 100644 (file)
@@ -422,8 +422,8 @@ static int WriteBlockToFile( access_t *p_access, block_t *p_block )
         if( !file && p_sys->i_files < 2 )
         {
             /* We just can't work with less than 2 buffer files */
-            msg_Err( p_access, "cannot open temporary file '%s' (%s)",
-                     p_sys->psz_filename, strerror(errno) );
+            msg_Err( p_access, "cannot open temporary file '%s' (%m)",
+                     p_sys->psz_filename );
             return VLC_EGENERIC;
         }
         else if( !file ) return VLC_EGENERIC;
index 32f7eb81447bd0222c151165ab1898ecac3d0884..5ffe02f05bc320bdce8431ebffe87097e5f79dba 100644 (file)
@@ -138,8 +138,7 @@ static int Open( vlc_object_t *p_this )
 
         if( fd == -1 )
         {
-            msg_Err( p_access, "cannot open `%s' (%s)", p_access->psz_path,
-                     strerror( errno ) );
+            msg_Err( p_access, "cannot open `%s' (%m)", p_access->psz_path );
             free( p_access->p_sys );
             return( VLC_EGENERIC );
         }
index e5e2cb3edcf79362de0cb32cc27b3bbd4ceb8d82..1ec9f39e0cc4a2e929ef8a5859f765157bfb0ef7 100644 (file)
@@ -465,10 +465,6 @@ static void ThreadWrite( vlc_object_t *p_this )
     mtime_t              i_date_last = -1;
     mtime_t              i_to_send = p_thread->i_group;
     int                  i_dropped_packets = 0;
-#if defined(WIN32) || defined(UNDER_CE)
-    char strerror_buf[WINSOCK_STRERROR_SIZE];
-# define strerror( x ) winsock_strerror( strerror_buf )
-#endif
 
     while( !p_thread->b_die )
     {
@@ -523,7 +519,7 @@ static void ThreadWrite( vlc_object_t *p_this )
                             p_pk->i_buffer, 0 );
         if (val == -1)
         {
-            msg_Warn( p_thread, "send error: %s", strerror(errno) );
+            msg_Warn( p_thread, "send error: %m" );
         }
 
         if( i_dropped_packets )
index 4db091ba079459b3ba5c6dd63d1fc5f838a27119..17c2056d8baeaf9856e2edfaf1a593ee9d3e53be 100644 (file)
@@ -682,7 +682,7 @@ static int Open( vlc_object_t *p_this )
     if( vlc_thread_create( p_aout, "aout", ALSAThread,
                            VLC_THREAD_PRIORITY_OUTPUT, VLC_FALSE ) )
     {
-        msg_Err( p_aout, "cannot create ALSA thread (%s)", strerror(errno) );
+        msg_Err( p_aout, "cannot create ALSA thread (%m)" );
         goto error;
     }
 
index 69a84cc90155357e5ae99b9e19cff862a6d7c6fb..5fca9c9dfab7403ab1ff4776bb88643340e8fcdd 100644 (file)
@@ -204,7 +204,7 @@ static void Play( aout_instance_t *p_aout )
             i_tmp = write( p_sys->i_fd, data + pos, ESD_BUF_SIZE );
             if( i_tmp < 0 )
             {
-                msg_Err( p_aout, "write failed (%s)", strerror(errno) );
+                msg_Err( p_aout, "write failed (%m)" );
             }
         }
         aout_BufferFree( p_buffer );
index 544d69b4bb1a63281fae057cd231288649f3199f..5ac85e353cd2b795647910ffd95d31cf4b936789 100644 (file)
@@ -267,7 +267,7 @@ static int Open( vlc_object_t * p_this )
         if( fwrite( wh, sizeof(WAVEHEADER), 1,
                     p_aout->output.p_sys->p_file ) != 1 )
         {
-            msg_Err( p_aout, "write error (%s)", strerror(errno) );
+            msg_Err( p_aout, "write error (%m)" );
         }
     }
 
@@ -292,7 +292,7 @@ static void Close( vlc_object_t * p_this )
         /* Write Wave Header */
         if( fseek( p_aout->output.p_sys->p_file, 0, SEEK_SET ) )
         {
-            msg_Err( p_aout, "seek error (%s)", strerror(errno) );
+            msg_Err( p_aout, "seek error (%m)" );
         }
 
         /* Header -> little endian format */
@@ -304,7 +304,7 @@ static void Close( vlc_object_t * p_this )
         if( fwrite( &p_aout->output.p_sys->waveh, sizeof(WAVEHEADER), 1,
                     p_aout->output.p_sys->p_file ) != 1 )
         {
-            msg_Err( p_aout, "write error (%s)", strerror(errno) );
+            msg_Err( p_aout, "write error (%m)" );
         }
     }
 
@@ -324,7 +324,7 @@ static void Play( aout_instance_t * p_aout )
     if( fwrite( p_buffer->p_buffer, p_buffer->i_nb_bytes, 1,
                 p_aout->output.p_sys->p_file ) != 1 )
     {
-        msg_Err( p_aout, "write error (%s)", strerror(errno) );
+        msg_Err( p_aout, "write error (%m)" );
     }
 
     if( p_aout->output.p_sys->b_add_wav_header )
index ff41330dd412eb6b2c1e0187315ca50a5ef7e8b2..13b30ba463f0d899f948f8683e17443b5fdafdd1 100644 (file)
@@ -170,7 +170,7 @@ static int Open( vlc_object_t * p_this )
     if( vlc_thread_create( p_aout, "aout", Thread,
                            VLC_THREAD_PRIORITY_OUTPUT, VLC_FALSE ) )
     {
-        msg_Err( p_aout, "cannot create OSS thread (%s)", strerror(errno) );
+        msg_Err( p_aout, "cannot create OSS thread (%m)" );
         pPlayer->Close();
         delete pPlayer;
         free( p_sys->ppBuffers );
index 3743488480df26cc43d3cf1a03ee1d90d581c0bd..ff542520a9056bb100746f19b5a10295ea7e751e 100644 (file)
@@ -515,7 +515,7 @@ static int Open( vlc_object_t *p_this )
     if( vlc_thread_create( p_aout, "aout", OSSThread,
                            VLC_THREAD_PRIORITY_OUTPUT, VLC_FALSE ) )
     {
-        msg_Err( p_aout, "cannot create OSS thread (%s)", strerror(errno) );
+        msg_Err( p_aout, "cannot create OSS thread (%m)" );
         close( p_sys->i_fd );
         free( p_sys );
         return VLC_ETHREAD;
index f84cc9a520fbcd77510f6d44b642650631e7d72b..a1577cbfbf26cc005c0513371f83d239b55a5eb8 100644 (file)
@@ -228,8 +228,7 @@ static int OpenDecoder( vlc_object_t *p_this )
     {
         p_sys->iconv_handle = vlc_iconv_open ("UTF-8", psz_charset);
         if (p_sys->iconv_handle == (vlc_iconv_t)(-1))
-            msg_Err (p_dec, "cannot convert from %s: %s", psz_charset,
-                     strerror (errno));
+            msg_Err (p_dec, "cannot convert from %s: %m", psz_charset);
     }
     free (psz_charset);
 
index 89ed3c102a114f8cfe113f0868376589d6d9860c..a5e217b9a5be7a825b959a5e7d02e37191b177a7 100644 (file)
@@ -921,8 +921,8 @@ void E_(Execute)( httpd_file_sys_t *p_args,
                     if( ( f = fopen( psz_file, "r" ) ) == NULL )
                     {
                         msg_Warn( p_args->p_intf,
-                                  "unable to include file %s (%s)",
-                                  psz_file, strerror(errno) );
+                                  "unable to include file %s (%m)",
+                                  psz_file );
                         break;
                     }
 
index 647df12725bc585bd7144fa9645459109a7adfa9..0156c8a7a25b2deb8c7b4340dbd8b5290fb171a3 100644 (file)
@@ -534,8 +534,7 @@ mvar_t *E_(mvar_FileSetNew)( intf_thread_t *p_intf, char *name,
     if( ( i_dir_content = utf8_scandir( psz_dir, &ppsz_dir_content, Filter,
                                         InsensitiveAlphasort ) ) == -1 )
     {
-        msg_Warn( p_intf, "error while scanning dir %s (%s)", psz_dir,
-                  strerror(errno) );
+        msg_Warn( p_intf, "error while scanning dir %s (%m)", psz_dir );
         free( psz_dir );
         return s;
     }
index b7bb602b2f2ed853309e0eee2c0d88b77a7158b3..5d2c4a0eddba24403a21f3711312e8daf9e8b475 100644 (file)
@@ -365,8 +365,8 @@ char *E_(FromUTF8)( intf_thread_t *p_intf, char *psz_utf8 )
         if( i_ret == (size_t)-1 || i_in )
         {
             msg_Warn( p_intf,
-                      "failed to convert \"%s\" to desired charset (%s)",
-                      psz_utf8, strerror(errno) );
+                      "failed to convert \"%s\" to desired charset (%m)",
+                      psz_utf8 );
             free( psz_local );
             return strdup( psz_utf8 );
         }
@@ -395,8 +395,8 @@ char *E_(ToUTF8)( intf_thread_t *p_intf, char *psz_local )
         if( i_ret == (size_t)-1 || i_in )
         {
             msg_Warn( p_intf,
-                      "failed to convert \"%s\" to desired charset (%s)",
-                      psz_local, strerror(errno) );
+                      "failed to convert \"%s\" to desired charset (%m)",
+                      psz_local );
             free( psz_utf8 );
             return strdup( psz_local );
         }
index d75c14d5239d50b5d13be10c456830f88de3eeca..c9bd4db33059be3e08a1bc765396b1790c952d85 100644 (file)
@@ -232,7 +232,7 @@ static int Activate( vlc_object_t *p_this )
 
         if( (i_socket = socket( AF_LOCAL, SOCK_STREAM, 0 ) ) < 0 )
         {
-            msg_Warn( p_intf, "can't open socket: %s", strerror(errno) );
+            msg_Warn( p_intf, "can't open socket: %m" );
             free( psz_unix_path );
             return VLC_EGENERIC;
         }
@@ -251,8 +251,8 @@ static int Activate( vlc_object_t *p_this )
 
             if (bind (i_socket, (struct sockaddr *)&addr, sizeof (addr)))
             {
-                msg_Err (p_intf, "cannot bind UNIX socket at %s: %s",
-                         psz_unix_path, strerror (errno));
+                msg_Err (p_intf, "cannot bind UNIX socket at %s: %m",
+                         psz_unix_path);
                 free (psz_unix_path);
                 net_Close (i_socket);
                 return VLC_EGENERIC;
@@ -261,7 +261,7 @@ static int Activate( vlc_object_t *p_this )
 
         if( listen( i_socket, 1 ) )
         {
-            msg_Warn( p_intf, "can't listen on socket: %s", strerror(errno));
+            msg_Warn( p_intf, "can't listen on socket: %m");
             free( psz_unix_path );
             net_Close( i_socket );
             return VLC_EGENERIC;
index 81313ec4060ac3fb71c4f24e9d19d739f1a7ad2b..05ece11630d0ecd400551847a9fbcecd6058b8bc 100644 (file)
@@ -1945,12 +1945,8 @@ static void ReadDir( intf_thread_t *p_intf )
         if( p_current_dir == NULL )
         {
             /* something went bad, get out of here ! */
-#ifdef HAVE_ERRNO_H
-            msg_Warn( p_intf, "cannot open directory `%s' (%s)",
-                      p_sys->psz_current_dir, strerror(errno));
-#else
-            msg_Warn( p_intf, "cannot open directory `%s'", p_sys->psz_current_dir );
-#endif
+            msg_Warn( p_intf, "cannot open directory `%s' (%m)",
+                      p_sys->psz_current_dir );
             return;
         }
 
index a334ee7f4162a8450c9d4655e45da96b70ab4fe9..0c26661fc56fdd23a8df9282ffef6976535c8d96 100644 (file)
@@ -174,7 +174,7 @@ int E_(OpenAudio)( vlc_object_t *p_this )
     if( vlc_thread_create( p_aout, "aout", QNXaoutThread,
                            VLC_THREAD_PRIORITY_OUTPUT, VLC_FALSE ) )
     {
-        msg_Err( p_aout, "cannot create QNX audio thread (%s)", strerror(errno) );
+        msg_Err( p_aout, "cannot create QNX audio thread (%m)" );
         E_(CloseAudio)( p_this );
         free( p_aout->output.p_sys );
         return -1;
@@ -307,7 +307,7 @@ static int QNXaoutThread( aout_instance_t * p_aout )
 
         if( i_tmp < 0 )
         {
-            msg_Err( p_aout, "write failed (%s)", strerror(errno) );
+            msg_Err( p_aout, "write failed (%m)" );
         }
 
         if ( p_buffer != NULL )
index 1f4f967675f22aec03265c9d814cb74f9f5b778f..3b1c7f92ebc406dd3883e9888ae4fbb775377419 100644 (file)
@@ -1112,8 +1112,8 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
 
         if( i_in_bytes )
         {
-            msg_Warn( p_filter, "failed to convert string to unicode (%s), "
-                      "bytes left %d", strerror(errno), (int)i_in_bytes );
+            msg_Warn( p_filter, "failed to convert string to unicode (%m), "
+                      "bytes left %u", (unsigned)i_in_bytes );
             goto error;
         }
         *(uint32_t*)p_out_buffer = 0;
@@ -1496,8 +1496,8 @@ static void IconvText( filter_t *p_filter, const char *psz_string,
 
             if( i_in_bytes )
             {
-                msg_Warn( p_filter, "failed to convert string to unicode (%s), "
-                          "bytes left %d", strerror(errno), (int)i_in_bytes );
+                msg_Warn( p_filter, "failed to convert string to unicode (%m), "
+                          "bytes left %u", (unsigned)i_in_bytes );
             }
             else
             {
index 04c87040e6977207c33b60107d524dfdb7c9ab71..ea39050db5b3c7da8284689ccf140f7ab4988e96 100644 (file)
@@ -568,8 +568,7 @@ gnutls_Addx509Directory( vlc_object_t *p_this,
     dir = utf8_opendir( psz_dirname );
     if( dir == NULL )
     {
-        msg_Warn( p_this, "cannot open directory (%s): %s", psz_dirname,
-                  strerror( errno ) );
+        msg_Warn( p_this, "cannot open directory (%s): %m", psz_dirname );
         return VLC_EGENERIC;
     }
 #ifdef S_ISLNK
@@ -655,8 +654,7 @@ gnutls_Addx509File( vlc_object_t *p_this,
         }
     }
     else
-        msg_Warn( p_this, "cannot add x509 credentials (%s): %s",
-                  psz_path, strerror( errno ) );
+        msg_Warn( p_this, "cannot add x509 credentials (%s): %m", psz_path );
     return VLC_EGENERIC;
 }
 
index 65a9b2b170d161604de8b98b0e7b66205df39ee2..c0a073084fa182623ae3001873486f00d5593105 100644 (file)
@@ -277,7 +277,7 @@ static int CheckAndSend( vlc_object_t *p_this, uint8_t* p_data, int i_offset )
     if( send( i_handle, p_data, i_offset, 0 )
           == -1 )
     {
-        msg_Warn( p_this, "send error: %s", strerror(errno) );
+        msg_Warn( p_this, "send error: %m" );
     }
     net_Close( i_handle );
 
index e65763f5eec826f5e039db1fcbb8b7d3e631f028..56c988c7d88ccd69b96d45e395863e655c590773 100644 (file)
@@ -1212,8 +1212,8 @@ static int FileSetup( sout_stream_t *p_stream )
 
     if( ( f = utf8_fopen( p_sys->psz_sdp_file, "wt" ) ) == NULL )
     {
-        msg_Err( p_stream, "cannot open file '%s' (%s)",
-                 p_sys->psz_sdp_file, strerror(errno) );
+        msg_Err( p_stream, "cannot open file '%s' (%m)",
+                 p_sys->psz_sdp_file );
         return VLC_EGENERIC;
     }
 
index 61ca899279f3c4a5ed5723637d6e28882a0f2d46..22723fde1dff74a30a5f30b859e250b87cd34902 100644 (file)
@@ -260,7 +260,7 @@ static int Create( vlc_object_t *p_this )
         if( sigaction( SIGUSR1, &sig_tty, &p_vout->p_sys->sig_usr1 ) ||
             sigaction( SIGUSR2, &sig_tty, &p_vout->p_sys->sig_usr2 ) )
         {
-            msg_Err( p_vout, "cannot set signal handler (%s)", strerror(errno) );
+            msg_Err( p_vout, "cannot set signal handler (%m)" );
             tcsetattr(0, 0, &p_vout->p_sys->old_termios);
             TextMode( p_sys->i_tty );
             free( p_vout->p_sys );
@@ -270,7 +270,7 @@ static int Create( vlc_object_t *p_this )
         /* Set-up tty according to new signal handler */
         if( -1 == ioctl( p_sys->i_tty, VT_GETMODE, &p_vout->p_sys->vt_mode ) )
         {
-            msg_Err( p_vout, "cannot get terminal mode (%s)", strerror(errno) );
+            msg_Err( p_vout, "cannot get terminal mode (%m)" );
             sigaction( SIGUSR1, &p_vout->p_sys->sig_usr1, NULL );
             sigaction( SIGUSR2, &p_vout->p_sys->sig_usr2, NULL );
             tcsetattr(0, 0, &p_vout->p_sys->old_termios);
@@ -286,7 +286,7 @@ static int Create( vlc_object_t *p_this )
 
         if( -1 == ioctl( p_sys->i_tty, VT_SETMODE, &vt_mode ) )
         {
-            msg_Err( p_vout, "cannot set terminal mode (%s)", strerror(errno) );
+            msg_Err( p_vout, "cannot set terminal mode (%m)" );
             sigaction( SIGUSR1, &p_vout->p_sys->sig_usr1, NULL );
             sigaction( SIGUSR2, &p_vout->p_sys->sig_usr2, NULL );
             tcsetattr(0, 0, &p_vout->p_sys->old_termios);
@@ -585,7 +585,7 @@ static int OpenDisplay( vout_thread_t *p_vout )
     p_vout->p_sys->i_fd = open( psz_device, O_RDWR);
     if( p_vout->p_sys->i_fd == -1 )
     {
-        msg_Err( p_vout, "cannot open %s (%s)", psz_device, strerror(errno) );
+        msg_Err( p_vout, "cannot open %s (%m)", psz_device );
         free( psz_device );
         return VLC_EGENERIC;
     }
@@ -596,7 +596,7 @@ static int OpenDisplay( vout_thread_t *p_vout )
     if( ioctl( p_vout->p_sys->i_fd,
                FBIOGET_VSCREENINFO, &p_vout->p_sys->var_info ) )
     {
-        msg_Err( p_vout, "cannot get fb info (%s)", strerror(errno) );
+        msg_Err( p_vout, "cannot get fb info (%m)" );
         close( p_vout->p_sys->i_fd );
         return VLC_EGENERIC;
     }
@@ -612,7 +612,7 @@ static int OpenDisplay( vout_thread_t *p_vout )
     if( ioctl( p_vout->p_sys->i_fd,
                FBIOPUT_VSCREENINFO, &p_vout->p_sys->var_info ) )
     {
-        msg_Err( p_vout, "cannot set fb info (%s)", strerror(errno) );
+        msg_Err( p_vout, "cannot set fb info (%m)" );
         close( p_vout->p_sys->i_fd );
         return VLC_EGENERIC;
     }
@@ -622,8 +622,7 @@ static int OpenDisplay( vout_thread_t *p_vout )
          || ioctl( p_vout->p_sys->i_fd,
                    FBIOGET_VSCREENINFO, &p_vout->p_sys->var_info ) )
     {
-        msg_Err( p_vout, "cannot get additional fb info (%s)",
-                          strerror(errno) );
+        msg_Err( p_vout, "cannot get additional fb info (%m)" );
 
         /* Restore fb config */
         ioctl( p_vout->p_sys->i_fd,
@@ -711,7 +710,7 @@ static int OpenDisplay( vout_thread_t *p_vout )
 
     if( p_vout->p_sys->p_video == ((void*)-1) )
     {
-        msg_Err( p_vout, "cannot map video memory (%s)", strerror(errno) );
+        msg_Err( p_vout, "cannot map video memory (%m)" );
 
         if( p_vout->p_sys->var_info.bits_per_pixel == 8 )
         {
index d0c76efa17d5f903c85f0c16731817a379893b1e..3b4ad84caffac089c9dac68e8ecba6dc4e45b3ce 100644 (file)
@@ -2020,8 +2020,7 @@ static void FreePicture( vout_thread_t *p_vout, picture_t *p_pic )
         shmctl( p_pic->p_sys->shminfo.shmid, IPC_RMID, 0 );
         if( shmdt( p_pic->p_sys->shminfo.shmaddr ) )
         {
-            msg_Err( p_vout, "cannot detach shared memory (%s)",
-                             strerror(errno) );
+            msg_Err( p_vout, "cannot detach shared memory (%m)" );
         }
     }
     else
@@ -2802,8 +2801,7 @@ static IMAGE_TYPE * CreateShmImage( vout_thread_t *p_vout,
     p_shm->shmid = shmget( IPC_PRIVATE, DATA_SIZE(p_image), IPC_CREAT | 0776 );
     if( p_shm->shmid < 0 )
     {
-        msg_Err( p_vout, "cannot allocate shared image data (%s)",
-                         strerror( errno ) );
+        msg_Err( p_vout, "cannot allocate shared image data (%m)" );
         IMAGE_FREE( p_image );
         return NULL;
     }
@@ -2812,8 +2810,7 @@ static IMAGE_TYPE * CreateShmImage( vout_thread_t *p_vout,
     p_shm->shmaddr = p_image->data = shmat( p_shm->shmid, 0, 0 );
     if(! p_shm->shmaddr )
     {
-        msg_Err( p_vout, "cannot attach shared memory (%s)",
-                         strerror(errno));
+        msg_Err( p_vout, "cannot attach shared memory (%m)" );
         IMAGE_FREE( p_image );
         shmctl( p_shm->shmid, IPC_RMID, 0 );
         return NULL;