aboutsummaryrefslogtreecommitdiffstats
path: root/src/command.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-09 19:17:44 +0200
committerEric Wong <normalperson@yhbt.net>2008-10-11 19:21:51 -0700
commit1d59716731f3ed8569d60ae84c291bd93eb7d582 (patch)
tree6c8e6e5e43190d98264f7c734102af7bb5e4ec96 /src/command.c
parente5c747982adfae06c51b60819ec6a4ef5a34ffe2 (diff)
downloadmpd-1d59716731f3ed8569d60ae84c291bd93eb7d582.tar.gz
mpd-1d59716731f3ed8569d60ae84c291bd93eb7d582.tar.xz
mpd-1d59716731f3ed8569d60ae84c291bd93eb7d582.zip
update: job ID must be positive
The documentation for directory_update_init() was incorrect: a job ID must be positive, not non-negative. If the update queue is full and no job was created, it makes more sense to return 0 instead of -1, because it is more consistent with the return value of isUpdatingDB().
Diffstat (limited to '')
-rw-r--r--src/command.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/command.c b/src/command.c
index aafb88418..541a71a50 100644
--- a/src/command.c
+++ b/src/command.c
@@ -788,14 +788,12 @@ static int handlePlaylistMove(int fd, mpd_unused int *permission,
static int print_update_result(int fd, int ret)
{
- if (ret >= 0) {
+ if (ret > 0) {
fdprintf(fd, "updating_db: %i\n", ret);
return 0;
}
- if (ret == -2)
- commandError(fd, ACK_ERROR_ARG, "invalid path");
- else
- commandError(fd, ACK_ERROR_UPDATE_ALREADY, "already updating");
+ assert(!ret);
+ commandError(fd, ACK_ERROR_UPDATE_ALREADY, "already updating");
return -1;
}