From: Cristian Rodríguez Date: Fri, 20 Feb 2015 18:14:56 +0000 (-0300) Subject: shared: fix wrong assertion in barrier_set_role() X-Git-Tag: v219.0~587 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=3f7f1fad7621f584d9ce024abb313ecbc9bd0e62;p=elogind.git shared: fix wrong assertion in barrier_set_role() assert(b->pipe[0] >= 0 && b->pipe[0] >= 0); Test the same condition twice, pretty sure we mean assert(b->pipe[0] >= 0 && b->pipe[1] >= 0); --- diff --git a/src/shared/barrier.c b/src/shared/barrier.c index ec121d740..a0326ac69 100644 --- a/src/shared/barrier.c +++ b/src/shared/barrier.c @@ -175,7 +175,7 @@ void barrier_set_role(Barrier *b, unsigned int role) { assert(b); assert(role == BARRIER_PARENT || role == BARRIER_CHILD); /* make sure this is only called once */ - assert(b->pipe[1] >= 0 && b->pipe[1] >= 0); + assert(b->pipe[0] >= 0 && b->pipe[1] >= 0); if (role == BARRIER_PARENT) b->pipe[1] = safe_close(b->pipe[1]);