aboutsummaryrefslogtreecommitdiffstats
path: root/src/directory.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/directory.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/directory.c b/src/directory.c
index 7bd9b9f61..9ad301092 100644
--- a/src/directory.c
+++ b/src/directory.c
@@ -979,9 +979,15 @@ void sortDirectory(Directory * directory) {
int writeDirectoryDB() {
FILE * fp;
+ DEBUG("removing empty directories from DB\n");
deleteEmptyDirectoriesInDirectory(mp3rootDirectory);
+
+ DEBUG("sorting DB\n");
+
sortDirectory(mp3rootDirectory);
+ DEBUG("writing DB\n");
+
while(!(fp=fopen(directory_db,"w")) && errno==EINTR);
if(!fp) return -1;
@@ -1077,6 +1083,8 @@ int readDirectoryDB() {
}
}
+ DEBUG("reading DB\n");
+
readDirectoryInfo(fp,mp3rootDirectory);
while(fclose(fp) && errno==EINTR);