diff mbox series

[babeltrace] Fix: remove g_spawn_check_exit_status to support glib 2.22

Message ID 1504119263-15163-1-git-send-email-mjeanson@efficios.com
State Accepted, archived
Headers show
Series [babeltrace] Fix: remove g_spawn_check_exit_status to support glib 2.22 | expand

Commit Message

Michael Jeanson Aug. 30, 2017, 6:54 p.m. UTC
Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
---
 tests/lib/test_ctf_writer.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Comments

Jérémie Galarneau Aug. 31, 2017, 8:54 p.m. UTC | #1
Merged, thanks!

Jérémie

On 30 August 2017 at 14:54, Michael Jeanson <mjeanson at efficios.com> wrote:
> Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
> ---
>  tests/lib/test_ctf_writer.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/tests/lib/test_ctf_writer.c b/tests/lib/test_ctf_writer.c
> index 3d24ea4..9c65d84 100644
> --- a/tests/lib/test_ctf_writer.c
> +++ b/tests/lib/test_ctf_writer.c
> @@ -122,10 +122,16 @@ void validate_trace(char *parser_path, char *trace_path)
>                 goto result;
>         }
>
> -       if(!g_spawn_check_exit_status(exit_status, NULL)) {
> +       /* Replace by g_spawn_check_exit_status when we require glib >= 2.34 */
> +#if G_OS_UNIX
> +       ret = WIFEXITED(exit_status) ? WEXITSTATUS(exit_status) : -1;
> +#else
> +       ret = exit_status;
> +#endif
> +
> +       if(ret != 0) {
>                 diag("Babeltrace returned an error.");
>                 diag_multiline(standard_error);
> -               ret = -1;
>                 goto result;
>         }
>
> --
> 2.7.4
>
diff mbox series

Patch

diff --git a/tests/lib/test_ctf_writer.c b/tests/lib/test_ctf_writer.c
index 3d24ea4..9c65d84 100644
--- a/tests/lib/test_ctf_writer.c
+++ b/tests/lib/test_ctf_writer.c
@@ -122,10 +122,16 @@  void validate_trace(char *parser_path, char *trace_path)
 		goto result;
 	}
 
-	if(!g_spawn_check_exit_status(exit_status, NULL)) {
+	/* Replace by g_spawn_check_exit_status when we require glib >= 2.34 */
+#if G_OS_UNIX
+	ret = WIFEXITED(exit_status) ? WEXITSTATUS(exit_status) : -1;
+#else
+	ret = exit_status;
+#endif
+
+	if(ret != 0) {
 		diag("Babeltrace returned an error.");
 		diag_multiline(standard_error);
-		ret = -1;
 		goto result;
 	}