print strerror() when having problems stat'ing
git-svn-id: https://svn.musicpd.org/mpd/trunk@1887 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
parent
8205e1bbc7
commit
8347e80838
@ -27,6 +27,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef HAVE_LOCALE
|
||||
#ifdef HAVE_LANGINFO_CODESET
|
||||
@ -116,11 +117,11 @@ void initPaths(char * playlistDirArg, char * musicDirArg) {
|
||||
|
||||
playlistDir = prependCwdToPathDup(playlistDirArg);
|
||||
if((stat(playlistDir,&st))<0) {
|
||||
ERROR("problem stat'ing \"%s\"\n",playlistDirArg);
|
||||
ERROR("problem stat'ing \"%s\": %s\n", playlistDirArg, strerror(errno));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if(!S_ISDIR(st.st_mode)) {
|
||||
ERROR("\"%s\" is not a directory\n",playlistDirArg);
|
||||
ERROR("\"%s\" is not a directory: %s\n", playlistDirArg, strerror(errno));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user