diff options
author | Eric Wong <normalperson@yhbt.net> | 2008-09-28 20:29:40 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-09-28 20:30:58 -0700 |
commit | 887f97b868886a66d7bb2fcd0e1fd6810297299d (patch) | |
tree | 7a4f050b0905fb5d0b645dfdb623dcc4fbc36852 /src/directory.c | |
parent | e7203ca8349f03c5364a97b9dee68a83e4d506dc (diff) | |
download | mpd-887f97b868886a66d7bb2fcd0e1fd6810297299d.tar.gz mpd-887f97b868886a66d7bb2fcd0e1fd6810297299d.tar.xz mpd-887f97b868886a66d7bb2fcd0e1fd6810297299d.zip |
clean up updateInit calling and error handling
Move error reporting to command.c so directory.c does not deal
with client error handling any more.
Diffstat (limited to '')
-rw-r--r-- | src/directory.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/directory.c b/src/directory.c index 124ea194e..a332316ff 100644 --- a/src/directory.c +++ b/src/directory.c @@ -18,7 +18,6 @@ #include "directory.h" -#include "command.h" #include "conf.h" #include "log.h" #include "ls.h" @@ -148,14 +147,13 @@ out: return (void *)ret; } -int updateInit(int fd, List * path_list) +int updateInit(List * path_list) { pthread_attr_t attr; - if (progress != UPDATE_PROGRESS_IDLE) { - commandError(fd, ACK_ERROR_UPDATE_ALREADY, "already updating"); + if (progress != UPDATE_PROGRESS_IDLE) return -1; - } + progress = UPDATE_PROGRESS_RUNNING; pthread_attr_init(&attr); @@ -166,9 +164,7 @@ int updateInit(int fd, List * path_list) directory_updateJobId = 1; DEBUG("updateInit: spawned update thread for update job id %i\n", (int)directory_updateJobId); - fdprintf(fd, "updating_db: %i\n", (int)directory_updateJobId); - - return 0; + return directory_updateJobId; } static void directory_set_stat(Directory * dir, const struct stat *st) |