From 6519cc41e2d7fd602795ebadeda4381e5bbf22c0 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 5 Oct 2008 01:01:31 -0700 Subject: directory: fix writeDirectoryDB Wow, I must have been halfway asleep when I did that... --- src/directory.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/directory.c') diff --git a/src/directory.c b/src/directory.c index 773b16db6..54f1af09c 100644 --- a/src/directory.c +++ b/src/directory.c @@ -860,10 +860,12 @@ int writeDirectoryDB(void) DIRECTORY_FS_CHARSET "%s\n" DIRECTORY_INFO_END "\n", getFsCharset()); - if (writeDirectoryInfo(fd, music_root) < 0) + if (writeDirectoryInfo(fd, music_root) < 0) { ERROR("Failed to write to database file: %s\n", strerror(errno)); - return -1; + xclose(fd); + return -1; + } xclose(fd); if (stat(dbFile, &st) == 0) -- cgit v1.2.3