aboutsummaryrefslogtreecommitdiffstats
path: root/src/directory.c
diff options
context:
space:
mode:
authorQball Cow <qball@qballcow.nl>2007-07-16 20:31:37 +0000
committerQball Cow <qball@qballcow.nl>2007-07-16 20:31:37 +0000
commit4811eadb4aa20a394092fd65afd55ad7f6539672 (patch)
treee20f5ad8e65ab03b8d5f31c9fcd72483da035516 /src/directory.c
parent54e6b27989733cdb3c3f23193ea300fd6c381978 (diff)
downloadmpd-4811eadb4aa20a394092fd65afd55ad7f6539672.tar.gz
mpd-4811eadb4aa20a394092fd65afd55ad7f6539672.tar.xz
mpd-4811eadb4aa20a394092fd65afd55ad7f6539672.zip
Extra debug output
git-svn-id: https://svn.musicpd.org/mpd/trunk@6689 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/directory.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/directory.c b/src/directory.c
index 560c04b7b..adfd1f238 100644
--- a/src/directory.c
+++ b/src/directory.c
@@ -915,15 +915,24 @@ static void writeDirectoryInfo(FILE * fp, Directory * directory)
{
ListNode *node = (directory->subDirectories)->firstNode;
Directory *subDirectory;
+ int retv;
if (directory->path) {
- fprintf(fp, "%s%s\n", DIRECTORY_BEGIN,
+ retv = fprintf(fp, "%s%s\n", DIRECTORY_BEGIN,
getDirectoryPath(directory));
+ if (retv < 0) {
+ ERROR("Failed to write data to database file: %s\n",strerror(errno));
+ return;
+ }
}
while (node != NULL) {
subDirectory = (Directory *) node->data;
- fprintf(fp, "%s%s\n", DIRECTORY_DIR, node->key);
+ retv = fprintf(fp, "%s%s\n", DIRECTORY_DIR, node->key);
+ if (retv < 0) {
+ ERROR("Failed to write data to database file: %s\n",strerror(errno));
+ return;
+ }
writeDirectoryInfo(fp, subDirectory);
node = node->nextNode;
}
@@ -931,8 +940,12 @@ static void writeDirectoryInfo(FILE * fp, Directory * directory)
writeSongInfoFromList(fp, directory->songs);
if (directory->path) {
- fprintf(fp, "%s%s\n", DIRECTORY_END,
+ retv = fprintf(fp, "%s%s\n", DIRECTORY_END,
getDirectoryPath(directory));
+ if (retv < 0) {
+ ERROR("Failed to write data to database file: %s\n",strerror(errno));
+ return;
+ }
}
}