From f1a27ed433b1ed7a0d12990ae36ab4f8bb7dbc5f Mon Sep 17 00:00:00 2001 From: koekeishiya Date: Sun, 14 Jul 2019 22:12:29 +0200 Subject: [PATCH] #131 write errors to stderr --- CHANGELOG.md | 1 + src/yabai.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61143858..76745ab9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## [Unreleased] ### Changed - Float native macOS fullscreen spaces [#130](https://github.com/koekeishiya/yabai/issues/130) +- Write error messsages returned to the client through *stderr* [#131](https://github.com/koekeishiya/yabai/issues/131) ## [1.1.1] - 2019-07-14 ### Changed diff --git a/src/yabai.c b/src/yabai.c index aee700c6..ba8bfbf2 100644 --- a/src/yabai.c +++ b/src/yabai.c @@ -99,13 +99,13 @@ static int client_send_message(int argc, char **argv) rsp[byte_count] = '\0'; if (rsp[0] == FAILURE_MESSAGE[0]) { - fprintf(stdout, "%s", rsp + 1); result = EXIT_FAILURE; + fprintf(stderr, "%s", rsp + 1); + fflush(stderr); } else { fprintf(stdout, "%s", rsp); + fflush(stdout); } - - fflush(stdout); } }