ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
Zbigniew Jędrzejewski-Szmek 399a2a
From c04228cbd9373f2e5242e871ef1cb8878559f27e Mon Sep 17 00:00:00 2001
Zbigniew Jędrzejewski-Szmek 399a2a
From: David Herrmann <dh.herrmann@gmail.com>
Zbigniew Jędrzejewski-Szmek 399a2a
Date: Tue, 16 Dec 2014 16:14:48 +0100
Zbigniew Jędrzejewski-Szmek 399a2a
Subject: [PATCH] console: fix error-code inversion
Zbigniew Jędrzejewski-Szmek 399a2a
Zbigniew Jędrzejewski-Szmek 399a2a
The error-code propagated via sysview is always negative. Avoid
Zbigniew Jędrzejewski-Szmek 399a2a
multiplying by -1 before returning it. Otherwise, we will return >0
Zbigniew Jędrzejewski-Szmek 399a2a
instead of <0, which will not be detected as error by sysview-core.
Zbigniew Jędrzejewski-Szmek 399a2a
Zbigniew Jędrzejewski-Szmek 399a2a
(cherry picked from commit 84c3561c58dd992b339afe5bb4c41971a2ebc486)
Zbigniew Jędrzejewski-Szmek 399a2a
---
Zbigniew Jędrzejewski-Szmek 399a2a
 src/console/consoled-manager.c | 2 +-
Zbigniew Jędrzejewski-Szmek 399a2a
 1 file changed, 1 insertion(+), 1 deletion(-)
Zbigniew Jędrzejewski-Szmek 399a2a
Zbigniew Jędrzejewski-Szmek 399a2a
diff --git a/src/console/consoled-manager.c b/src/console/consoled-manager.c
Zbigniew Jędrzejewski-Szmek 399a2a
index 9dd62f04a0..25de0a218f 100644
Zbigniew Jędrzejewski-Szmek 399a2a
--- a/src/console/consoled-manager.c
Zbigniew Jędrzejewski-Szmek 399a2a
+++ b/src/console/consoled-manager.c
Zbigniew Jędrzejewski-Szmek 399a2a
@@ -228,7 +228,7 @@ static int manager_sysview_session_control(Manager *m, sysview_event *event) {
Zbigniew Jędrzejewski-Szmek 399a2a
                                 sysview_session_get_name(session));
Zbigniew Jędrzejewski-Szmek 399a2a
                 session_free(s);
Zbigniew Jędrzejewski-Szmek 399a2a
                 sysview_session_set_userdata(session, NULL);
Zbigniew Jędrzejewski-Szmek 399a2a
-                return -error;
Zbigniew Jędrzejewski-Szmek 399a2a
+                return error;
Zbigniew Jędrzejewski-Szmek 399a2a
         }
Zbigniew Jędrzejewski-Szmek 399a2a
 
Zbigniew Jędrzejewski-Szmek 399a2a
         return 0;