Commit 2b78358a authored by Denis Krjuchkov's avatar Denis Krjuchkov Committed by Max Kellermann

mpd_error: more correct MPD_ERROR implementation

Original implementation does not handle if (...) MPD_ERROR("die"); else ... case well. This change fixes handling of such cases.
parent a59ab3e2
...@@ -28,9 +28,9 @@ ...@@ -28,9 +28,9 @@
* proper error handling. */ * proper error handling. */
#define MPD_ERROR(...) \ #define MPD_ERROR(...) \
{ \ do { \
g_critical(__VA_ARGS__); \ g_critical(__VA_ARGS__); \
exit(EXIT_FAILURE); \ exit(EXIT_FAILURE); \
} } while(0)
#endif #endif
...@@ -124,7 +124,7 @@ audio_output_all_init(void) ...@@ -124,7 +124,7 @@ audio_output_all_init(void)
if (!audio_output_init(output, param, &error)) { if (!audio_output_init(output, param, &error)) {
if (param != NULL) if (param != NULL)
MPD_ERROR("line %i: %s", MPD_ERROR("line %i: %s",
param->line, error->message) param->line, error->message);
else else
MPD_ERROR("%s", error->message); MPD_ERROR("%s", error->message);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment