diff options
author | Eric Wong <normalperson@yhbt.net> | 2008-10-05 01:01:31 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-10-05 01:01:31 -0700 |
commit | 6519cc41e2d7fd602795ebadeda4381e5bbf22c0 (patch) | |
tree | 4f88bb23e3be56ce3c5f102b14504062e8381e50 | |
parent | 4e11e2960ba4e10e3fba61abed2e97c745581245 (diff) | |
download | mpd-6519cc41e2d7fd602795ebadeda4381e5bbf22c0.tar.gz mpd-6519cc41e2d7fd602795ebadeda4381e5bbf22c0.tar.xz mpd-6519cc41e2d7fd602795ebadeda4381e5bbf22c0.zip |
directory: fix writeDirectoryDB
Wow, I must have been halfway asleep when I did that...
-rw-r--r-- | src/directory.c | 6 |
1 files changed, 4 insertions, 2 deletions
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) |