anitazha / rpms / systemd

Forked from rpms/systemd 3 years ago
Clone

Blame SOURCES/0057-shared-fix-wrong-assertion-in-barrier_set_role.patch

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