diff options
author | Max Kellermann <max@duempel.org> | 2009-01-01 19:22:07 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-01 19:22:07 +0100 |
commit | 0c422838a8ae724e1c906028311665f0d9ea26c1 (patch) | |
tree | fed87056923c4156d7b8a865ec8620c4700db514 /src/playlist.c | |
parent | 80fa9183e4d30643b1e089d9b96f36a4b266276e (diff) | |
download | mpd-0c422838a8ae724e1c906028311665f0d9ea26c1.tar.gz mpd-0c422838a8ae724e1c906028311665f0d9ea26c1.tar.xz mpd-0c422838a8ae724e1c906028311665f0d9ea26c1.zip |
playlist: use g_file_test() instead of stat()
To find out whether a file exists, use g_file_test() instead of
stat(), because it is more portable and easier to use.
Diffstat (limited to '')
-rw-r--r-- | src/playlist.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/playlist.c b/src/playlist.c index 0c93f92b0..7abb7436f 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -1202,14 +1202,13 @@ void shufflePlaylist(void) enum playlist_result savePlaylist(const char *utf8file) { FILE *fp; - struct stat sb; char *path; if (!is_valid_playlist_name(utf8file)) return PLAYLIST_RESULT_BAD_NAME; path = map_spl_utf8_to_fs(utf8file); - if (!stat(path, &sb)) { + if (g_file_test(path, G_FILE_TEST_EXISTS)) { g_free(path); return PLAYLIST_RESULT_LIST_EXISTS; } |