Commit 08c13220 authored by Max Kellermann's avatar Max Kellermann

update: never pass root path to updatePath()

update_task() already checks if it has got a root path. Extend this check and in turn remove a check in the inner function updatePath().
parent 6b9ffcff
...@@ -392,11 +392,6 @@ static enum update_return updatePath(const char *path) ...@@ -392,11 +392,6 @@ static enum update_return updatePath(const char *path)
directory_sort(directory); directory_sort(directory);
return ret; return ret;
} }
/* we don't want to delete the root directory */
else if (directory == db_get_root()) {
clear_directory(directory);
return UPDATE_RETURN_NOUPDATE;
}
/* if updateDirectory fails, means we should delete it */ /* if updateDirectory fails, means we should delete it */
else { else {
LOG("removing directory: %s\n", path); LOG("removing directory: %s\n", path);
...@@ -456,7 +451,7 @@ static void * update_task(void *_path) ...@@ -456,7 +451,7 @@ static void * update_task(void *_path)
{ {
enum update_return ret = UPDATE_RETURN_NOUPDATE; enum update_return ret = UPDATE_RETURN_NOUPDATE;
if (_path) { if (_path != NULL && !isRootDirectory(_path)) {
ret = updatePath((char *)_path); ret = updatePath((char *)_path);
free(_path); free(_path);
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment