aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-09-07 13:44:20 +0200
committerMax Kellermann <max@duempel.org>2008-09-07 13:44:20 +0200
commitd8ef33b71025decd52eaec5bb8417ad8e6dff873 (patch)
tree0b13311f3085a42b2479232536a4d94083c48df7 /src
parenta8b225f947fc2d5e464222ea9b535c49fbce9ac9 (diff)
downloadmpd-d8ef33b71025decd52eaec5bb8417ad8e6dff873.tar.gz
mpd-d8ef33b71025decd52eaec5bb8417ad8e6dff873.tar.xz
mpd-d8ef33b71025decd52eaec5bb8417ad8e6dff873.zip
playlist: PlaylistInfo() does not call commandError()
Continuing the effort of removing protocol specific calls from the core libraries: let the command.c code call commandError() based on PlaylistInfo's return value.
Diffstat (limited to '')
-rw-r--r--src/command.c16
-rw-r--r--src/playlist.c5
2 files changed, 15 insertions, 6 deletions
diff --git a/src/command.c b/src/command.c
index 6bdfba58b..a11978a6c 100644
--- a/src/command.c
+++ b/src/command.c
@@ -540,13 +540,25 @@ static int handleLoad(int fd, mpd_unused int *permission,
static int handleListPlaylist(int fd, mpd_unused int *permission,
mpd_unused int argc, char *argv[])
{
- return PlaylistInfo(fd, argv[1], 0);
+ int ret;
+
+ ret = PlaylistInfo(fd, argv[1], 0);
+ if (ret == -1)
+ commandError(fd, ACK_ERROR_NO_EXIST, "No such playlist");
+
+ return ret;
}
static int handleListPlaylistInfo(int fd, mpd_unused int *permission,
mpd_unused int argc, char *argv[])
{
- return PlaylistInfo(fd, argv[1], 1);
+ int ret;
+
+ ret = PlaylistInfo(fd, argv[1], 1);
+ if (ret == -1)
+ commandError(fd, ACK_ERROR_NO_EXIST, "No such playlist");
+
+ return ret;
}
static int handleLsInfo(int fd, mpd_unused int *permission,
diff --git a/src/playlist.c b/src/playlist.c
index 107e67588..54ec74a5a 100644
--- a/src/playlist.c
+++ b/src/playlist.c
@@ -1342,11 +1342,8 @@ int PlaylistInfo(int fd, const char *utf8file, int detail)
ListNode *node;
List *list;
- if (!(list = loadStoredPlaylist(utf8file))) {
- commandError(fd, ACK_ERROR_NO_EXIST, "could not open playlist "
- "\"%s\": %s", utf8file, strerror(errno));
+ if (!(list = loadStoredPlaylist(utf8file)))
return -1;
- }
node = list->firstNode;
while (node != NULL) {