Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
cead5e5b
Commit
cead5e5b
authored
Nov 28, 2011
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mapper: fix the bogus "not a directory" error message
Use stat() instead of g_file_test() to detect other types of errors, such as "permission denied".
parent
cf15629a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
NEWS
NEWS
+1
-0
mapper.c
src/mapper.c
+13
-1
No files found.
NEWS
View file @
cead5e5b
...
...
@@ -4,6 +4,7 @@ ver 0.16.6 (2010/??/??)
* encoder:
- flac, null, wave: fix buffer corruption bug
- wave: support packed 24 bit samples
* mapper: fix the bogus "not a directory" error message
* log: print reason for failure
* event_pipe: fix WIN32 regression
* define WINVER in ./configure
...
...
src/mapper.c
View file @
cead5e5b
...
...
@@ -31,6 +31,9 @@
#include <assert.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
#include <errno.h>
static
char
*
music_dir
;
static
size_t
music_dir_length
;
...
...
@@ -54,8 +57,17 @@ strdup_chop_slash(const char *path_fs)
static
void
check_directory
(
const
char
*
path
)
{
if
(
!
g_file_test
(
path
,
G_FILE_TEST_IS_DIR
))
struct
stat
st
;
if
(
stat
(
path
,
&
st
)
<
0
)
{
g_warning
(
"Failed to stat directory
\"
%s
\"
: %s"
,
path
,
g_strerror
(
errno
));
return
;
}
if
(
!
S_ISDIR
(
st
.
st_mode
))
{
g_warning
(
"Not a directory: %s"
,
path
);
return
;
}
}
static
void
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment