aboutsummaryrefslogtreecommitdiffstats
path: root/src/database.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-01-31 22:12:14 +0100
committerMax Kellermann <max@duempel.org>2012-02-02 18:06:33 +0100
commitef5cf40fa6d3e2f50ad916be8e5bd99affe7d2e3 (patch)
treebffd4ea35f30f96e8dc8d1ac74184bd4dab5d5d6 /src/database.c
parent837bd79b20d4b9b8525a42999a9d1911f8980aa4 (diff)
downloadmpd-ef5cf40fa6d3e2f50ad916be8e5bd99affe7d2e3.tar.gz
mpd-ef5cf40fa6d3e2f50ad916be8e5bd99affe7d2e3.tar.xz
mpd-ef5cf40fa6d3e2f50ad916be8e5bd99affe7d2e3.zip
directory: require the caller to lock the db_mutex
Reduce the number of lock/unlock cycles, and make database handling safer.
Diffstat (limited to 'src/database.c')
-rw-r--r--src/database.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/database.c b/src/database.c
index 9c4d90a2b..8c903bb45 100644
--- a/src/database.c
+++ b/src/database.c
@@ -92,7 +92,9 @@ db_get_directory(const char *name)
if (name == NULL)
return music_root;
- return directory_lookup_directory(music_root, name);
+ struct directory *directory =
+ directory_lookup_directory(music_root, name);
+ return directory;
}
struct song *