teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

Blame 0041-shared-fix-wrong-assertion-in-barrier_set_role.patch

Zbigniew Jędrzejewski-Szmek 399a2a
From cf0e4940eadeb4636a958e8d7bc243dd03120eb8 Mon Sep 17 00:00:00 2001
Zbigniew Jędrzejewski-Szmek 399a2a
From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= <crrodriguez@opensuse.org>
Zbigniew Jędrzejewski-Szmek 399a2a
Date: Fri, 20 Feb 2015 15:14:56 -0300
Zbigniew Jędrzejewski-Szmek 399a2a
Subject: [PATCH] shared: fix wrong assertion in barrier_set_role()
Zbigniew Jędrzejewski-Szmek 399a2a
Zbigniew Jędrzejewski-Szmek 399a2a
 assert(b->pipe[0] >= 0 && b->pipe[0] >= 0);
Zbigniew Jędrzejewski-Szmek 399a2a
Zbigniew Jędrzejewski-Szmek 399a2a
Test the same condition twice, pretty sure we mean
Zbigniew Jędrzejewski-Szmek 399a2a
Zbigniew Jędrzejewski-Szmek 399a2a
 assert(b->pipe[0] >= 0 && b->pipe[1] >= 0);
Zbigniew Jędrzejewski-Szmek 399a2a
Zbigniew Jędrzejewski-Szmek 399a2a
(cherry picked from commit 3f7f1fad7621f584d9ce024abb313ecbc9bd0e62)
Zbigniew Jędrzejewski-Szmek 399a2a
---
Zbigniew Jędrzejewski-Szmek 399a2a
 src/shared/barrier.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/shared/barrier.c b/src/shared/barrier.c
Zbigniew Jędrzejewski-Szmek 399a2a
index f65363a67b..b7dca75097 100644
Zbigniew Jędrzejewski-Szmek 399a2a
--- a/src/shared/barrier.c
Zbigniew Jędrzejewski-Szmek 399a2a
+++ b/src/shared/barrier.c
Zbigniew Jędrzejewski-Szmek 399a2a
@@ -178,7 +178,7 @@ void barrier_set_role(Barrier *b, unsigned int role) {
Zbigniew Jędrzejewski-Szmek 399a2a
         assert(b);
Zbigniew Jędrzejewski-Szmek 399a2a
         assert(role == BARRIER_PARENT || role == BARRIER_CHILD);
Zbigniew Jędrzejewski-Szmek 399a2a
         /* make sure this is only called once */
Zbigniew Jędrzejewski-Szmek 399a2a
-        assert(b->pipe[1] >= 0 && b->pipe[1] >= 0);
Zbigniew Jędrzejewski-Szmek 399a2a
+        assert(b->pipe[0] >= 0 && b->pipe[1] >= 0);
Zbigniew Jędrzejewski-Szmek 399a2a
 
Zbigniew Jędrzejewski-Szmek 399a2a
         if (role == BARRIER_PARENT)
Zbigniew Jędrzejewski-Szmek 399a2a
                 b->pipe[1] = safe_close(b->pipe[1]);