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
This commit is contained in:
parent
c825401760
commit
74e75378ae
@ -1212,12 +1212,15 @@ mpd_fprintf_ void commandError(int fd, int error, const char *fmt, ...)
|
|||||||
if (current_command) {
|
if (current_command) {
|
||||||
fdprintf(fd, "ACK [%i@%i] {%s} ",
|
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;
|
current_command = NULL;
|
||||||
} else
|
} else {
|
||||||
fdprintf(STDERR_FILENO, "ACK [%i@%i] ",
|
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);
|
va_end(args);
|
||||||
fdprintf(fd, "\n");
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user