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;
}
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 )
{
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;
/* 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;
}
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;
}
/* 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;
}
if( errno == EINTR )
continue;
- msg_Err( p_access, "poll error: %s", strerror(errno) );
+ msg_Err( p_access, "poll error: %m" );
return NULL;
}
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;
}
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;
}
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;
}
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;
}
}
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;
}
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;
}
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;
}
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;
}
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;
}
/* 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;
}
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. */
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;
}
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;
}
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;
}
/* 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;
}
/* 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;
}
/* 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;
}
/* 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;
}
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;
}
/* 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;
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;
}
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;
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;
}
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;
}
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;
}
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 */
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));
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));
if( i_ret < 0 )
{
- msg_Err( p_access, "network select error (%s)", strerror(errno) );
+ msg_Err( p_access, "network select error (%m)" );
return -1;
}
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;
}
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;
}
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
{
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
{
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
{
if( i_ret < 0 )
{
- msg_Err( p_access, "Select error (%s).", strerror( errno ) );
+ msg_Err( p_access, "Polling error (%m)." );
return -1;
}
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;
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;
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
#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;
}
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
#endif
if( i_ret == -1 )
{
- msg_Err( p_access, "seek failed (%s)", strerror(errno) );
+ msg_Err( p_access, "seek failed (%m)" );
return VLC_EGENERIC;
}
#endif
if( i_read < 0 )
{
- msg_Err( p_access, "read failed (%s)", strerror(errno) );
+ msg_Err( p_access, "read failed (%m)" );
return -1;
}
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;
}
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,
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;
}
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 "
//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;
}
}
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,
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;
}
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;
}
}
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;
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;
}
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;
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;
}
|| 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;
}
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;
}
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;
}
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;
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;
}
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;
}
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",
{
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;
}
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, "
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;
}
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;
}
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;
}
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;
}
{
if (ferror (oldstream))
{
- msg_Err (access, "cannot read temporary file: %s",
- strerror (errno));
+ msg_Err (access, "cannot read temporary file: %m");
break;
}
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;
}
}
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;
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;
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 );
}
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 )
{
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 )
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;
}
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 );
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)" );
}
}
/* 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 */
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)" );
}
}
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 )
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 );
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;
{
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);
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;
}
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;
}
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 );
}
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 );
}
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;
}
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;
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;
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;
}
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;
if( i_tmp < 0 )
{
- msg_Err( p_aout, "write failed (%s)", strerror(errno) );
+ msg_Err( p_aout, "write failed (%m)" );
}
if ( p_buffer != NULL )
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;
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
{
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
}
}
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;
}
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 );
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;
}
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 );
/* 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);
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);
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;
}
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;
}
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;
}
|| 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,
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 )
{
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
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;
}
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;