switch (pid)
{
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[1]);
return -1;
#include <stdlib.h> /* free(), strtol() */
#include <stdio.h> /* FILE */
-#include <string.h> /* strerror() */
+#include <string.h>
#include <vlc_interface.h>
#include <vlc_playlist.h>
#include <errno.h> /* ENOMEM */
#include <stdio.h> /* sprintf() */
-#include <string.h> /* strerror() */
+#include <string.h>
#include <stdlib.h> /* free() */
#ifndef WIN32
}
else
{
- msg_Err( p_libvlc, "cannot open pid file for writing: %s (%s)",
- psz_pidfile, strerror(errno) );
+ msg_Err( p_libvlc, "cannot open pid file for writing: %s (%m)",
+ psz_pidfile );
}
}
free( psz_pidfile );
msg_Dbg( p_libvlc, "removing pid file %s", psz_pidfile );
if( unlink( psz_pidfile ) == -1 )
{
- msg_Dbg( p_libvlc, "removing pid file %s: failed: %s",
- psz_pidfile, strerror(errno) );
+ msg_Dbg( p_libvlc, "removing pid file %s: %m",
+ psz_pidfile );
}
}
free ( psz_pidfile );
}
/* 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.
*/
if (bind_textdomain_codeset (PACKAGE_NAME, "UTF-8") == NULL)
file = utf8_fopen( psz_url, "wb" );
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;
}
err = errno;
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;
}
p_stream = utf8_fopen( psz_filename, mode );
if( p_stream == NULL && errno != ENOENT )
{
- msg_Err( p_obj, "cannot open config file (%s): %s",
- psz_filename, strerror(errno) );
+ msg_Err( p_obj, "cannot open config file (%s): %m",
+ psz_filename );
}
#if !( defined(WIN32) || defined(__APPLE__) || defined(SYS_BEOS) )
{
long l = strtoi (psz_option_value);
if (errno)
- msg_Warn (p_this, "Integer value (%s) for %s: %s",
- psz_option_value, psz_option_name,
- strerror (errno));
+ msg_Warn (p_this, "Integer value (%s) for %s: %m",
+ psz_option_value, psz_option_name);
else
p_item->saved.i = p_item->value.i = (int)l;
break;
if (ferror (file))
{
- msg_Err (p_this, "error reading configuration: %s", strerror (errno));
+ msg_Err (p_this, "error reading configuration: %m");
clearerr (file);
}
fclose (file);
}
free( psz_parent );
}
- msg_Err( p_this, "could not create %s (%s)",
- psz_dirname, strerror(errno) );
+ msg_Err( p_this, "could not create %s: %m", psz_dirname );
return -1;
}
msg_Warn( p_module, "cannot find symbol \"%s\" in file `%s' (%s)",
psz_name, p_module->psz_filename, dlerror() );
#elif defined(HAVE_DL_SHL_LOAD)
- msg_Warn( p_module, "cannot find symbol \"%s\" in file `%s' (%s)",
- psz_name, p_module->psz_filename, strerror(errno) );
+ msg_Warn( p_module, "cannot find symbol \"%s\" in file `%s' (%m)",
+ psz_name, p_module->psz_filename );
#else
# error "Something is wrong in modules.c"
#endif
handle = shl_load( psz_file, BIND_IMMEDIATE | BIND_NONFATAL, NULL );
if( handle == NULL )
{
- msg_Warn( p_this, "cannot load module `%s' (%s)",
- psz_file, strerror(errno) );
+ msg_Warn( p_this, "cannot load module `%s' (%m)", psz_file );
return -1;
}
p_export->p_file = utf8_fopen( psz_filename, "wt" );
if( !p_export->p_file )
{
- msg_Err( p_playlist , "could not create playlist file %s"
- " (%s)", psz_filename, strerror(errno) );
+ msg_Err( p_playlist , "could not create playlist file %s (%m)",
+ psz_filename );
return VLC_EGENERIC;
}