Commit 8347e808 authored by Warren Dukes's avatar Warren Dukes

print strerror() when having problems stat'ing

git-svn-id: https://svn.musicpd.org/mpd/trunk@1887 09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent 8205e1bb
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h>
#ifdef HAVE_LOCALE #ifdef HAVE_LOCALE
#ifdef HAVE_LANGINFO_CODESET #ifdef HAVE_LANGINFO_CODESET
...@@ -116,11 +117,11 @@ void initPaths(char * playlistDirArg, char * musicDirArg) { ...@@ -116,11 +117,11 @@ void initPaths(char * playlistDirArg, char * musicDirArg) {
playlistDir = prependCwdToPathDup(playlistDirArg); playlistDir = prependCwdToPathDup(playlistDirArg);
if((stat(playlistDir,&st))<0) { 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); exit(EXIT_FAILURE);
} }
if(!S_ISDIR(st.st_mode)) { 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); exit(EXIT_FAILURE);
} }
......
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