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().
This commit is contained in:
Max Kellermann
2008-10-09 19:17:44 +02:00
parent 79a28e5c72
commit f1022bcc12
4 changed files with 16 additions and 20 deletions

View File

@@ -436,9 +436,9 @@ int directory_update_init(char *path)
int next_task_id;
if (!path)
return -1;
return 0;
if (update_paths_nr == ARRAY_SIZE(update_paths))
return -1;
return 0;
assert(update_paths_nr < ARRAY_SIZE(update_paths));
update_paths[update_paths_nr++] = path;
next_task_id = update_task_id + update_paths_nr;