Commit 552e5951 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Replace strerror() with %m (or Linux DVB: strerror_r) - refs #1297

parent 7c7854e7
......@@ -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;
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
}
......
......@@ -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;
}
......
......@@ -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));
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}