From ef6c500edb7dc1a4eb9bff11b83b57dd60d37d4a Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Fri, 4 Jun 2004 00:49:33 +0000 Subject: clean up ACK error coding a little bit git-svn-id: https://svn.musicpd.org/mpd/trunk@1321 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/interface.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/interface.c') diff --git a/src/interface.c b/src/interface.c index 2fb95ae1c..4abbc8c4f 100644 --- a/src/interface.c +++ b/src/interface.c @@ -41,7 +41,7 @@ #include #include -#define GREETING "MPD" +#define GREETING "OK MPD" #define INTERFACE_MAX_BUFFER_LENGTH MAXPATHLEN+1024 #define INTERFACE_LIST_MODE_BEGIN "command_list_begin" @@ -120,8 +120,7 @@ void openInterface(Interface * interface, int fd) { #endif interface->outBuffer = malloc(interface->outBufSize); - myfprintf(interface->fp,"%s %s %s\n",COMMAND_RESPOND_OK,GREETING, - VERSION); + myfprintf(interface->fp, "%s %s\n", GREETING, VERSION); printInterfaceOutBuffer(interface); } @@ -237,9 +236,7 @@ int interfaceReadInput(Interface * interface) { interface->num, ret); if(ret==0) { - myfprintf(interface->fp, - "%s\n", - COMMAND_RESPOND_OK); + commandSuccess(interface->fp); } else if(ret==COMMAND_RETURN_CLOSE || interface->expired) { @@ -291,7 +288,8 @@ int interfaceReadInput(Interface * interface) { INTERFACE_LIST_MODE_END) ==0) { - myfprintf(interface->fp,"%s not in command list mode\n",COMMAND_RESPOND_ERROR); + commandError(interface->fp, + "not in command list mode"); ret = -1; } else { @@ -304,7 +302,7 @@ int interfaceReadInput(Interface * interface) { DEBUG("interface %i: command returned %i\n",interface->num,ret); } if(ret==0) { - myfprintf(interface->fp,"%s\n",COMMAND_RESPOND_OK); + commandSuccess(interface->fp); } else if(ret==COMMAND_RETURN_CLOSE || interface->expired) { -- cgit v1.2.3