aboutsummaryrefslogtreecommitdiffstats
path: root/src/directory.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-06-04 00:49:33 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-06-04 00:49:33 +0000
commitef6c500edb7dc1a4eb9bff11b83b57dd60d37d4a (patch)
tree26e7b16fbeb8bef1b45a9a7a035d5a3309c0145a /src/directory.c
parentdafe92a9edd35ef805963d30e953bcadd78074d3 (diff)
downloadmpd-ef6c500edb7dc1a4eb9bff11b83b57dd60d37d4a.tar.gz
mpd-ef6c500edb7dc1a4eb9bff11b83b57dd60d37d4a.tar.xz
mpd-ef6c500edb7dc1a4eb9bff11b83b57dd60d37d4a.zip
clean up ACK error coding a little bit
git-svn-id: https://svn.musicpd.org/mpd/trunk@1321 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/directory.c')
-rw-r--r--src/directory.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/directory.c b/src/directory.c
index 79b3b1bb9..f73a4f14c 100644
--- a/src/directory.c
+++ b/src/directory.c
@@ -166,7 +166,7 @@ void readDirectoryDBIfUpdateIsFinished() {
int updateInit(FILE * fp, List * pathList) {
if(directory_updatePid > 0) {
- myfprintf(fp,"%s already updating\n",COMMAND_RESPOND_ERROR);
+ commandError(fp, "already updating");
return -1;
}
@@ -223,8 +223,7 @@ int updateInit(FILE * fp, List * pathList) {
else if(directory_updatePid < 0) {
unblockSignals();
ERROR("updateInit: Problems forking()'ing\n");
- myfprintf(fp,"%s problems trying to update\n",
- COMMAND_RESPOND_ERROR);
+ commandError(fp, "problems trying to update");
directory_updatePid = 0;
return -1;
}
@@ -745,7 +744,7 @@ int printDirectoryInfo(FILE * fp, char * name) {
Directory * directory;
if((directory = getDirectory(name))==NULL) {
- myfprintf(fp,"%s: directory not found\n",COMMAND_RESPOND_ERROR);
+ commandError(fp, "directory not found");
return -1;
}
@@ -988,13 +987,13 @@ int updateMp3Directory(FILE * fp) {
break;
default:
ERROR("problems updating music db\n");
- myfprintf(fp,"%s problems updating music db\n",COMMAND_RESPOND_ERROR);
+ commandError(fp, "problems updating music db");
return -1;
}
if(writeDirectoryDB()<0) {
ERROR("problems writing music db file, \"%s\"\n",directory_db);
- myfprintf(fp,"%s problems writing music db\n",COMMAND_RESPOND_ERROR);
+ commandError(fp, "problems writing music db");
return -1;
}
@@ -1048,7 +1047,7 @@ int traverseAllIn(FILE * fp, char * name,
if((song = getSongFromDB(name)) && forEachSong) {
return forEachSong(fp, song, data);
}
- myfprintf(fp,"%s: directory or file not found\n",COMMAND_RESPOND_ERROR);
+ commandError(fp, "directory or file not found");
return -1;
}
@@ -1130,7 +1129,7 @@ int searchForSongsIn(FILE * fp, char * name, char * item, char * string) {
ret = traverseAllIn(fp,name,searchForFilenameInDirectory,NULL,
(void *)dup);
}
- else myfprintf(fp,"%s unknown table\n",COMMAND_RESPOND_ERROR);
+ else commandError(fp, "unknown table");
free(dup);
@@ -1167,7 +1166,7 @@ int findSongsIn(FILE * fp, char * name, char * item, char * string) {
(void *)string);
}
- myfprintf(fp,"%s unknown table\n",COMMAND_RESPOND_ERROR);
+ commandError(fp, "unknown table");
return -1;
}