aboutsummaryrefslogtreecommitdiffstats
path: root/src/directory.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-09-07 13:50:06 +0200
committerMax Kellermann <max@duempel.org>2008-09-07 13:50:06 +0200
commit8e3c40f032d1c760b9dc11df654c577baaf5f76a (patch)
tree687efc5e38d704c43675dd841a2ec67dc701f478 /src/directory.c
parent17b6491bcf37503bbc5d6cf6cee00bd1c6ec834a (diff)
downloadmpd-8e3c40f032d1c760b9dc11df654c577baaf5f76a.tar.gz
mpd-8e3c40f032d1c760b9dc11df654c577baaf5f76a.tar.xz
mpd-8e3c40f032d1c760b9dc11df654c577baaf5f76a.zip
directory: don't pass "fd" to updateInit()
Again, move error handling to command.c.
Diffstat (limited to 'src/directory.c')
-rw-r--r--src/directory.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/directory.c b/src/directory.c
index a9cb892a8..2e3e61f6f 100644
--- a/src/directory.c
+++ b/src/directory.c
@@ -18,7 +18,6 @@
#include "directory.h"
-#include "command.h"
#include "conf.h"
#include "client.h"
#include "listen.h"
@@ -30,7 +29,6 @@
#include "stats.h"
#include "utils.h"
#include "volume.h"
-#include "ack.h"
#include "myfprintf.h"
#include "dbUtils.h"
#include "song_print.h"
@@ -160,12 +158,10 @@ void readDirectoryDBIfUpdateIsFinished(void)
}
}
-int updateInit(int fd, List * pathList)
+int updateInit(List * pathList)
{
- if (directory_updatePid > 0) {
- commandError(fd, ACK_ERROR_UPDATE_ALREADY, "already updating");
- return -1;
- }
+ if (directory_updatePid > 0)
+ return 0;
/* need to block CHLD signal, cause it can exit before we
even get a chance to assign directory_updatePID */
@@ -216,8 +212,6 @@ int updateInit(int fd, List * pathList)
} else if (directory_updatePid < 0) {
unblockSignals();
ERROR("updateInit: Problems forking()'ing\n");
- commandError(fd, ACK_ERROR_SYSTEM,
- "problems trying to update");
directory_updatePid = 0;
return -1;
}
@@ -228,9 +222,8 @@ int updateInit(int fd, List * pathList)
directory_updateJobId = 1;
DEBUG("updateInit: fork()'d update child for update job id %i\n",
(int)directory_updateJobId);
- fdprintf(fd, "updating_db: %i\n", (int)directory_updateJobId);
- return 0;
+ return (int)directory_updateJobId;
}
static DirectoryStat *newDirectoryStat(struct stat *st)