aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ. Alexander Treuman <jat@spatialrift.net>2007-04-08 15:26:48 +0000
committerJ. Alexander Treuman <jat@spatialrift.net>2007-04-08 15:26:48 +0000
commit74e75378ae680c1fea4904f8e53152bd9db4dcba (patch)
treef018c84b921211c074bcc480610707edfef48043
parentc825401760d5ea067b8e4e1b81191c41914bd552 (diff)
downloadmpd-74e75378ae680c1fea4904f8e53152bd9db4dcba.tar.gz
mpd-74e75378ae680c1fea4904f8e53152bd9db4dcba.tar.xz
mpd-74e75378ae680c1fea4904f8e53152bd9db4dcba.zip
If current_command is NULL when calling commandError, print the error
message and trailing new line to STDERR_FILENO along with the ACK, instead of sending them over the socket. git-svn-id: https://svn.musicpd.org/mpd/trunk@5890 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/command.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/command.c b/src/command.c
index 5f5be15ea..27e493046 100644
--- a/src/command.c
+++ b/src/command.c
@@ -1211,13 +1211,16 @@ mpd_fprintf_ void commandError(int fd, int error, const char *fmt, ...)
if (current_command) {
fdprintf(fd, "ACK [%i@%i] {%s} ",
- (int)error, command_listNum, current_command);
+ (int)error, command_listNum, current_command);
+ vfdprintf(fd, fmt, args);
+ fdprintf(fd, "\n");
current_command = NULL;
- } else
+ } else {
fdprintf(STDERR_FILENO, "ACK [%i@%i] ",
- (int)error, command_listNum);
+ (int)error, command_listNum);
+ vfdprintf(STDERR_FILENO, fmt, args);
+ fdprintf(STDERR_FILENO, "\n");
+ }
- vfdprintf(fd, fmt, args);
va_end(args);
- fdprintf(fd, "\n");
}