Commit 8d8b50a4 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

VDR: use vlc_strerror() and vlc_strerror_c()

parent d610d175
...@@ -368,9 +368,10 @@ static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len ) ...@@ -368,9 +368,10 @@ static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len )
else else
{ {
/* abort on read error */ /* abort on read error */
msg_Err( p_access, "failed to read (%m)" ); msg_Err( p_access, "failed to read (%s)", vlc_strerror_c(errno) );
dialog_Fatal( p_access, _("File reading failed"), "%s (%m)", dialog_Fatal( p_access, _("File reading failed"),
_("VLC could not read the file.") ); _("VLC could not read the file (%s)."),
vlc_strerror(errno) );
SwitchFile( p_access, -1 ); SwitchFile( p_access, -1 );
return 0; return 0;
} }
...@@ -464,7 +465,8 @@ static bool ImportNextFile( access_t *p_access ) ...@@ -464,7 +465,8 @@ static bool ImportNextFile( access_t *p_access )
struct stat st; struct stat st;
if( vlc_stat( psz_path, &st ) ) if( vlc_stat( psz_path, &st ) )
{ {
msg_Dbg( p_access, "could not stat %s: %m", psz_path ); msg_Dbg( p_access, "could not stat %s: %s", psz_path,
vlc_strerror_c(errno) );
free( psz_path ); free( psz_path );
return false; return false;
} }
...@@ -514,7 +516,8 @@ static bool SwitchFile( access_t *p_access, unsigned i_file ) ...@@ -514,7 +516,8 @@ static bool SwitchFile( access_t *p_access, unsigned i_file )
if( p_sys->fd == -1 ) if( p_sys->fd == -1 )
{ {
msg_Err( p_access, "Failed to open %s: %m", psz_path ); msg_Err( p_access, "Failed to open %s: %s", psz_path,
vlc_strerror_c(errno) );
goto error; goto error;
} }
...@@ -534,7 +537,7 @@ static bool SwitchFile( access_t *p_access, unsigned i_file ) ...@@ -534,7 +537,7 @@ static bool SwitchFile( access_t *p_access, unsigned i_file )
error: error:
dialog_Fatal (p_access, _("File reading failed"), _("VLC could not" dialog_Fatal (p_access, _("File reading failed"), _("VLC could not"
" open the file \"%s\". (%m)"), psz_path); " open the file \"%s\" (%s)."), psz_path, vlc_strerror(errno) );
if( p_sys->fd != -1 ) if( p_sys->fd != -1 )
{ {
close( p_sys->fd ); close( p_sys->fd );
...@@ -599,7 +602,8 @@ static FILE *OpenRelativeFile( access_t *p_access, const char *psz_file ) ...@@ -599,7 +602,8 @@ static FILE *OpenRelativeFile( access_t *p_access, const char *psz_file )
FILE *file = vlc_fopen( psz_path, "rb" ); FILE *file = vlc_fopen( psz_path, "rb" );
if( !file ) if( !file )
msg_Warn( p_access, "Failed to open %s: %m", psz_path ); msg_Warn( p_access, "Failed to open %s: %s", psz_path,
vlc_strerror_c(errno) );
free( psz_path ); free( psz_path );
return file; return file;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment