diff options
author | Max Kellermann <max@duempel.org> | 2008-10-09 19:11:54 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-10-09 19:11:54 +0200 |
commit | 7dd099a60f0a966382e5369ac064f9089ce0c8c9 (patch) | |
tree | 9758b6b6f278be7374aefb0487e4aafb4340e46b /src/update.c | |
parent | 0677116da0d61097af44e5d84d763ccae450c077 (diff) | |
download | mpd-7dd099a60f0a966382e5369ac064f9089ce0c8c9.tar.gz mpd-7dd099a60f0a966382e5369ac064f9089ce0c8c9.tar.xz mpd-7dd099a60f0a966382e5369ac064f9089ce0c8c9.zip |
update: don't export updateDirectory()
If the user requests database update during startup, call
directory_update_init(). This should be changed to fully asynchronous
update later.
For this to work, main_notify has to be initialized before db_init().
Diffstat (limited to 'src/update.c')
-rw-r--r-- | src/update.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/update.c b/src/update.c index 3e9d98453..2c84d2521 100644 --- a/src/update.c +++ b/src/update.c @@ -30,6 +30,12 @@ #include "condition.h" #include "update.h" +enum update_return { + UPDATE_RETURN_ERROR = -1, + UPDATE_RETURN_NOUPDATE = 0, + UPDATE_RETURN_UPDATED = 1 +}; + enum update_progress { UPDATE_PROGRESS_IDLE = 0, UPDATE_PROGRESS_RUNNING = 1, @@ -204,6 +210,9 @@ inodeFoundInParent(struct directory *parent, ino_t inode, dev_t device) } static enum update_return +updateDirectory(struct directory *directory); + +static enum update_return addSubDirectoryToDirectory(struct directory *directory, const char *name, const struct stat *st) { @@ -280,7 +289,7 @@ static int skip_path(const char *path) return (path[0] == '.' || strchr(path, '\n')) ? 1 : 0; } -enum update_return +static enum update_return updateDirectory(struct directory *directory) { bool was_empty = directory_is_empty(directory); |