From 4811eadb4aa20a394092fd65afd55ad7f6539672 Mon Sep 17 00:00:00 2001 From: Qball Cow Date: Mon, 16 Jul 2007 20:31:37 +0000 Subject: Extra debug output git-svn-id: https://svn.musicpd.org/mpd/trunk@6689 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/directory.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src') 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; + } } } -- cgit v1.2.3