richardphibel / rpms / systemd

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