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().
This commit is contained in:
Max Kellermann
2008-10-09 19:11:54 +02:00
parent 0677116da0
commit 7dd099a60f
4 changed files with 25 additions and 14 deletions

View File

@@ -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,
@@ -203,6 +209,9 @@ inodeFoundInParent(struct directory *parent, ino_t inode, dev_t device)
return 0;
}
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);