Commit 2578127f authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Remove remaining strerror() calls from core - refs #1297

parent 4ff99618
...@@ -947,7 +947,7 @@ int __vlc_execve( vlc_object_t *p_object, int i_argc, char *const *ppsz_argv, ...@@ -947,7 +947,7 @@ int __vlc_execve( vlc_object_t *p_object, int i_argc, char *const *ppsz_argv,
switch (pid) switch (pid)
{ {
case -1: case -1:
msg_Err (p_object, "unable to fork (%s)", strerror (errno)); msg_Err (p_object, "unable to fork (%m)");
close (fds[0]); close (fds[0]);
close (fds[1]); close (fds[1]);
return -1; return -1;
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include <stdlib.h> /* free(), strtol() */ #include <stdlib.h> /* free(), strtol() */
#include <stdio.h> /* FILE */ #include <stdio.h> /* FILE */
#include <string.h> /* strerror() */ #include <string.h>
#include <vlc_interface.h> #include <vlc_interface.h>
#include <vlc_playlist.h> #include <vlc_playlist.h>
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
#include <errno.h> /* ENOMEM */ #include <errno.h> /* ENOMEM */
#include <stdio.h> /* sprintf() */ #include <stdio.h> /* sprintf() */
#include <string.h> /* strerror() */ #include <string.h>
#include <stdlib.h> /* free() */ #include <stdlib.h> /* free() */
#ifndef WIN32 #ifndef WIN32
...@@ -374,8 +374,8 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, char *ppsz_argv[] ) ...@@ -374,8 +374,8 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, char *ppsz_argv[] )
} }
else else
{ {
msg_Err( p_libvlc, "cannot open pid file for writing: %s (%s)", msg_Err( p_libvlc, "cannot open pid file for writing: %s (%m)",
psz_pidfile, strerror(errno) ); psz_pidfile );
} }
} }
free( psz_pidfile ); free( psz_pidfile );
...@@ -1035,8 +1035,8 @@ int libvlc_InternalDestroy( libvlc_int_t *p_libvlc, vlc_bool_t b_release ) ...@@ -1035,8 +1035,8 @@ int libvlc_InternalDestroy( libvlc_int_t *p_libvlc, vlc_bool_t b_release )
msg_Dbg( p_libvlc, "removing pid file %s", psz_pidfile ); msg_Dbg( p_libvlc, "removing pid file %s", psz_pidfile );
if( unlink( psz_pidfile ) == -1 ) if( unlink( psz_pidfile ) == -1 )
{ {
msg_Dbg( p_libvlc, "removing pid file %s: failed: %s", msg_Dbg( p_libvlc, "removing pid file %s: %m",
psz_pidfile, strerror(errno) ); psz_pidfile );
} }
} }
free ( psz_pidfile ); free ( psz_pidfile );
...@@ -1210,7 +1210,7 @@ static inline int LoadMessages (void) ...@@ -1210,7 +1210,7 @@ static inline int LoadMessages (void)
} }
/* LibVLC wants all messages in UTF-8. /* LibVLC wants all messages in UTF-8.
* Unfortunately, we cannot ask UTF-8 for strerror(), strsignal() * Unfortunately, we cannot ask UTF-8 for strerror_r(), strsignal_r()
* and other functions that are not part of our text domain. * and other functions that are not part of our text domain.
*/ */
if (bind_textdomain_codeset (PACKAGE_NAME, "UTF-8") == NULL) if (bind_textdomain_codeset (PACKAGE_NAME, "UTF-8") == NULL)
......
...@@ -352,7 +352,7 @@ static int ImageWriteUrl( image_handler_t *p_image, picture_t *p_pic, ...@@ -352,7 +352,7 @@ static int ImageWriteUrl( image_handler_t *p_image, picture_t *p_pic,
file = utf8_fopen( psz_url, "wb" ); file = utf8_fopen( psz_url, "wb" );
if( !file ) if( !file )
{ {
msg_Err( p_image->p_parent, "%s: %s", psz_url, strerror( errno ) ); msg_Err( p_image->p_parent, "%s: %m", psz_url );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -370,7 +370,10 @@ static int ImageWriteUrl( image_handler_t *p_image, picture_t *p_pic, ...@@ -370,7 +370,10 @@ static int ImageWriteUrl( image_handler_t *p_image, picture_t *p_pic,
err = errno; err = errno;
if( err ) if( err )
msg_Err( p_image->p_parent, "%s: %s", psz_url, strerror( err ) ); {
errno = err;
msg_Err( p_image->p_parent, "%s: %m", psz_url );
}
return err ? VLC_EGENERIC : VLC_SUCCESS; return err ? VLC_EGENERIC : VLC_SUCCESS;
} }
......
...@@ -799,8 +799,8 @@ static FILE *config_OpenConfigFile( vlc_object_t *p_obj, const char *mode ) ...@@ -799,8 +799,8 @@ static FILE *config_OpenConfigFile( vlc_object_t *p_obj, const char *mode )
p_stream = utf8_fopen( psz_filename, mode ); p_stream = utf8_fopen( psz_filename, mode );
if( p_stream == NULL && errno != ENOENT ) if( p_stream == NULL && errno != ENOENT )
{ {
msg_Err( p_obj, "cannot open config file (%s): %s", msg_Err( p_obj, "cannot open config file (%s): %m",
psz_filename, strerror(errno) ); psz_filename );
} }
#if !( defined(WIN32) || defined(__APPLE__) || defined(SYS_BEOS) ) #if !( defined(WIN32) || defined(__APPLE__) || defined(SYS_BEOS) )
...@@ -988,9 +988,8 @@ int __config_LoadConfigFile( vlc_object_t *p_this, const char *psz_module_name ) ...@@ -988,9 +988,8 @@ int __config_LoadConfigFile( vlc_object_t *p_this, const char *psz_module_name )
{ {
long l = strtoi (psz_option_value); long l = strtoi (psz_option_value);
if (errno) if (errno)
msg_Warn (p_this, "Integer value (%s) for %s: %s", msg_Warn (p_this, "Integer value (%s) for %s: %m",
psz_option_value, psz_option_name, psz_option_value, psz_option_name);
strerror (errno));
else else
p_item->saved.i = p_item->value.i = (int)l; p_item->saved.i = p_item->value.i = (int)l;
break; break;
...@@ -1030,7 +1029,7 @@ int __config_LoadConfigFile( vlc_object_t *p_this, const char *psz_module_name ) ...@@ -1030,7 +1029,7 @@ int __config_LoadConfigFile( vlc_object_t *p_this, const char *psz_module_name )
if (ferror (file)) if (ferror (file))
{ {
msg_Err (p_this, "error reading configuration: %s", strerror (errno)); msg_Err (p_this, "error reading configuration: %m");
clearerr (file); clearerr (file);
} }
fclose (file); fclose (file);
...@@ -1069,8 +1068,7 @@ int config_CreateDir( vlc_object_t *p_this, const char *psz_dirname ) ...@@ -1069,8 +1068,7 @@ int config_CreateDir( vlc_object_t *p_this, const char *psz_dirname )
} }
free( psz_parent ); free( psz_parent );
} }
msg_Err( p_this, "could not create %s (%s)", msg_Err( p_this, "could not create %s: %m", psz_dirname );
psz_dirname, strerror(errno) );
return -1; return -1;
} }
......
...@@ -1370,8 +1370,8 @@ static int CallEntry( module_t * p_module ) ...@@ -1370,8 +1370,8 @@ static int CallEntry( module_t * p_module )
msg_Warn( p_module, "cannot find symbol \"%s\" in file `%s' (%s)", msg_Warn( p_module, "cannot find symbol \"%s\" in file `%s' (%s)",
psz_name, p_module->psz_filename, dlerror() ); psz_name, p_module->psz_filename, dlerror() );
#elif defined(HAVE_DL_SHL_LOAD) #elif defined(HAVE_DL_SHL_LOAD)
msg_Warn( p_module, "cannot find symbol \"%s\" in file `%s' (%s)", msg_Warn( p_module, "cannot find symbol \"%s\" in file `%s' (%m)",
psz_name, p_module->psz_filename, strerror(errno) ); psz_name, p_module->psz_filename );
#else #else
# error "Something is wrong in modules.c" # error "Something is wrong in modules.c"
#endif #endif
...@@ -1503,8 +1503,7 @@ static int LoadModule( vlc_object_t *p_this, char *psz_file, ...@@ -1503,8 +1503,7 @@ static int LoadModule( vlc_object_t *p_this, char *psz_file,
handle = shl_load( psz_file, BIND_IMMEDIATE | BIND_NONFATAL, NULL ); handle = shl_load( psz_file, BIND_IMMEDIATE | BIND_NONFATAL, NULL );
if( handle == NULL ) if( handle == NULL )
{ {
msg_Warn( p_this, "cannot load module `%s' (%s)", msg_Warn( p_this, "cannot load module `%s' (%m)", psz_file );
psz_file, strerror(errno) );
return -1; return -1;
} }
......
...@@ -55,8 +55,8 @@ int playlist_Export( playlist_t * p_playlist, const char *psz_filename , ...@@ -55,8 +55,8 @@ int playlist_Export( playlist_t * p_playlist, const char *psz_filename ,
p_export->p_file = utf8_fopen( psz_filename, "wt" ); p_export->p_file = utf8_fopen( psz_filename, "wt" );
if( !p_export->p_file ) if( !p_export->p_file )
{ {
msg_Err( p_playlist , "could not create playlist file %s" msg_Err( p_playlist , "could not create playlist file %s (%m)",
" (%s)", psz_filename, strerror(errno) ); psz_filename );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
......
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