FILE *p_stream = vlc_fopen( psz_filename, "rt" );
if( p_stream == NULL && errno != ENOENT )
{
- msg_Err( p_obj, "cannot open config file (%s): %m",
- psz_filename );
+ msg_Err( p_obj, "cannot open config file (%s): %s",
+ psz_filename, vlc_strerror_c(errno) );
}
#if !( defined(_WIN32) || defined(__APPLE__) || defined(__OS2__) )
if ((l > item->max.i) || (l < item->min.i))
errno = ERANGE;
if (errno)
- msg_Warn (p_this, "Integer value (%s) for %s: %m",
- psz_option_value, psz_option_name);
+ msg_Warn (p_this, "Integer value (%s) for %s: %s",
+ psz_option_value, psz_option_name,
+ vlc_strerror_c(errno));
else
item->value.i = l;
break;
if (ferror (file))
{
- msg_Err (p_this, "error reading configuration: %m");
+ msg_Err (p_this, "error reading configuration: %s",
+ vlc_strerror_c(errno));
clearerr (file);
}
fclose (file);
}
}
- msg_Warn( p_this, "could not create %s: %m", psz_dirname );
+ msg_Warn( p_this, "could not create %s: %s", psz_dirname,
+ vlc_strerror_c(errno) );
return -1;
}
FILE *file = fdopen (fd, "wt");
if (file == NULL)
{
- msg_Err (p_this, "cannot create configuration file: %m");
+ msg_Err (p_this, "cannot create configuration file: %s",
+ vlc_strerror_c(errno));
vlc_rwlock_unlock (&config_lock);
close (fd);
vlc_mutex_unlock (&lock);
}
else
{
- //fprintf( stderr, "TsStoragePopCmd: %m\n" );
+ //perror( "TsStoragePopCmd" );
p_cmd->u.send.p_block = block_Alloc( 1 );
}
}
#include <stdio.h> /* sprintf() */
#include <string.h>
#include <stdlib.h> /* free() */
+#include <errno.h>
#include "config/vlc_getopt.h"
}
else
{
- msg_Err( p_libvlc, "cannot open pid file for writing: %s (%m)",
- psz_pidfile );
+ msg_Err( p_libvlc, "cannot open pid file %s for writing: %s",
+ psz_pidfile, vlc_strerror_c(errno) );
}
}
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: %m",
- psz_pidfile );
+ msg_Dbg( p_libvlc, "removing pid file %s: %s",
+ psz_pidfile, vlc_strerror_c(errno) );
}
}
free( psz_pidfile );
file = vlc_fopen( psz_url, "wb" );
if( !file )
{
- msg_Err( p_image->p_parent, "%s: %m", psz_url );
+ msg_Err( p_image->p_parent, "%s: %s", psz_url, vlc_strerror_c(errno) );
return VLC_EGENERIC;
}
if( err )
{
errno = err;
- msg_Err( p_image->p_parent, "%s: %m", psz_url );
+ msg_Err( p_image->p_parent, "%s: %s", psz_url, vlc_strerror_c(errno) );
}
return err ? VLC_EGENERIC : VLC_SUCCESS;
file = vlc_fopen( psz_filename, "rb" );
if( !file )
{
- msg_Warn( p_this, "cannot read %s (%m)",
- psz_filename );
+ msg_Warn( p_this, "cannot read %s: %s", psz_filename,
+ vlc_strerror_c(errno) );
free( psz_filename );
return 0;
}
if (file == NULL)
{
if (errno != EACCES && errno != ENOENT)
- msg_Warn (p_this, "cannot create %s (%m)", tmpname);
+ msg_Warn (p_this, "cannot create %s: %s", tmpname,
+ vlc_strerror_c(errno));
goto out;
}
if (CacheSaveBank (file, entries, n))
{
- msg_Warn (p_this, "cannot write %s (%m)", tmpname);
+ msg_Warn (p_this, "cannot write %s: %s", tmpname,
+ vlc_strerror_c(errno));
clearerr (file);
fclose (file);
vlc_unlink (tmpname);
if( vlc_object_waitpipe( VLC_OBJECT( host ) ) == -1 )
{
- msg_Err( host, "signaling pipe error: %m" );
+ msg_Err( host, "signaling pipe error: %s", vlc_strerror_c(errno) );
goto error;
}
if (errno != EINTR)
{
/* Kernel on low memory or a bug: pace */
- msg_Err( host, "polling error: %m" );
+ msg_Err( host, "polling error: %s",
+ vlc_strerror_c(errno) );
msleep( 100000 );
}
case 0:
if (fd == -1)
{
if (net_errno != EAFNOSUPPORT)
- msg_Err (p_this, "cannot create socket: %m");
+ msg_Err (p_this, "cannot create socket: %s",
+ vlc_strerror_c(net_errno));
return -1;
}
ptr->ai_protocol);
if (fd == -1)
{
- msg_Dbg (p_this, "socket error: %m");
+ msg_Dbg (p_this, "socket error: %s", vlc_strerror_c(net_errno));
continue;
}
else
#endif
{
- msg_Err (p_this, "socket bind error (%m)");
+ msg_Err (p_this, "socket bind error: %s",
+ vlc_strerror_c(net_errno));
continue;
}
}
#endif
if (listen (fd, INT_MAX))
{
- msg_Err (p_this, "socket listen error (%m)");
+ msg_Err (p_this, "socket listen error: %s",
+ vlc_strerror_c(net_errno));
net_Close (fd);
continue;
}
return i_total;
error:
- msg_Err (p_this, "read error: %m");
+ msg_Err (p_this, "read error: %s", vlc_strerror_c(errno));
return -1;
}
{
if (errno == EINTR)
continue;
- msg_Err (p_this, "Polling error: %m");
+ msg_Err (p_this, "Polling error: %s", vlc_strerror_c(errno));
return -1;
}
{
if (errno == EINTR)
continue;
- msg_Err (p_this, "Write error: %m");
+ msg_Err (p_this, "Write error: %s", vlc_strerror_c(errno));
break;
}
ptr->ai_socktype, ptr->ai_protocol );
if( fd == -1 )
{
- msg_Dbg( p_this, "socket error: %m" );
+ msg_Dbg( p_this, "socket error: %s", vlc_strerror_c(net_errno) );
continue;
}
if( net_errno != EINPROGRESS && net_errno != EINTR )
{
- msg_Err( p_this, "connection failed: %m" );
+ msg_Err( p_this, "connection failed: %s",
+ vlc_strerror_c(net_errno) );
goto next_ai;
}
switch (val)
{
case -1: /* error */
- msg_Err (p_this, "connection polling error: %m");
+ msg_Err (p_this, "polling error: %s",
+ vlc_strerror_c(net_errno));
goto next_ai;
case 0: /* timeout */
if (getsockopt (fd, SOL_SOCKET, SO_ERROR, &val,
&(socklen_t){ sizeof (val) }) || val)
{
- errno = val;
- msg_Err (p_this, "connection failed: %m");
+ msg_Err (p_this, "connection failed: %s",
+ vlc_strerror_c(val));
goto next_ai;
}
}
if (fd == -1)
{
if (net_errno != EAGAIN && net_errno != EWOULDBLOCK)
- msg_Err (obj, "accept failed (from socket %d): %m", lfd);
+ msg_Err (obj, "accept failed (from socket %d): %s", lfd,
+ vlc_strerror_c(net_errno));
return -1;
}
{
if (net_errno != EINTR)
{
- msg_Err (p_this, "poll error: %m");
+ msg_Err (p_this, "poll error: %s", vlc_strerror_c(net_errno));
return -1;
}
}
#endif
if (bind (fd, ptr->ai_addr, ptr->ai_addrlen))
{
- msg_Err( p_obj, "socket bind error (%m)" );
+ msg_Err( p_obj, "socket bind error: %s", vlc_strerror_c(net_errno) );
net_Close (fd);
return -1;
}
ptr->ai_protocol);
if (fd == -1)
{
- msg_Dbg (obj, "socket error: %m");
+ msg_Dbg (obj, "socket error: %s", vlc_strerror_c(net_errno));
continue;
}
default:
errno = EAFNOSUPPORT;
- msg_Warn( p_this, "%m" );
+ msg_Warn( p_this, "%s", vlc_strerror_c(EAFNOSUPPORT) );
return VLC_EGENERIC;
}
/* BSD compatibility */
unsigned char buf;
- msg_Dbg( p_this, "cannot set hop limit (%d): %m", hlim );
+ msg_Dbg( p_this, "cannot set hop limit (%d): %s", hlim,
+ vlc_strerror_c(net_errno) );
buf = (unsigned char)(( hlim > 255 ) ? 255 : hlim);
if( setsockopt( fd, proto, cmd, &buf, sizeof( buf ) ) )
{
- msg_Err( p_this, "cannot set hop limit (%d): %m", hlim );
+ msg_Err( p_this, "cannot set hop limit (%d): %s", hlim,
+ vlc_strerror_c(net_errno) );
return VLC_EGENERIC;
}
}
default:
errno = EAFNOSUPPORT;
}
- msg_Err (p_this, "cannot force multicast interface %s: %m", iface);
+ msg_Err (p_this, "cannot force multicast interface %s: %s", iface,
+ vlc_strerror_c(errno));
return -1;
}
}
#endif
- msg_Err (obj, "cannot join source multicast group: %m");
+ msg_Err (obj, "cannot join source multicast group: %s",
+ vlc_strerror_c(net_errno));
msg_Warn (obj, "trying ASM instead of SSM...");
return net_Subscribe (obj, fd, grp, grplen);
}
}
#endif
- msg_Err (obj, "cannot join multicast group: %m");
+ msg_Err (obj, "cannot join multicast group: %s",
+ vlc_strerror_c(net_errno));
return -1;
}
#endif
b_unreach = true;
else
- msg_Warn( p_this, "%s port %d : %m", psz_host, i_port);
+ msg_Warn( p_this, "%s port %d : %s", psz_host, i_port,
+ vlc_strerror_c(errno) );
net_Close( fd );
}
ptr->ai_addr, ptr->ai_addrlen)
: connect (fd, ptr2->ai_addr, ptr2->ai_addrlen))
{
- msg_Err (obj, "cannot connect to %s port %d: %m",
- psz_server, i_server);
+ msg_Err (obj, "cannot connect to %s port %d: %s",
+ psz_server, i_server, vlc_strerror_c(net_errno));
continue;
}
val = fd;
#include <assert.h>
#include <sys/stat.h>
+#include <errno.h>
#include <vlc_common.h>
#include <vlc_playlist.h>
{
if( fwrite( data, 1, length, f ) != length )
{
- msg_Err( obj, "%s: %m", psz_filename );
+ msg_Err( obj, "%s: %s", psz_filename, vlc_strerror_c(errno) );
}
else
{
if ( f )
{
if( fputs( "file://", f ) < 0 || fputs( psz_filename, f ) < 0 )
- msg_Err( obj, "Error writing %s: %m", psz_byuidfile );
+ msg_Err( obj, "Error writing %s: %s", psz_byuidfile,
+ vlc_strerror_c(errno) );
fclose( f );
}
free( psz_byuidfile );
# include "config.h"
#endif
+#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
p_export->psz_filename = psz_filename;
p_export->p_file = vlc_fopen( psz_filename, "wt" );
if( p_export->p_file == NULL )
- msg_Err( p_export, "could not create playlist file %s (%m)",
- psz_filename );
+ msg_Err( p_export, "could not create playlist file %s: %s",
+ psz_filename, vlc_strerror_c(errno) );
else
{
module_t *p_module;