From 104b14ec7f5f2d09505ff45f1721cc4bb851e719 Mon Sep 17 00:00:00 2001 From: ckolivas Date: Thu, 6 Jun 2013 13:22:12 +1000 Subject: [PATCH] Failed reads and writes on cgsem_post and cgsem_wait should be extremely rare. --- util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util.c b/util.c index f91763a9..4d48dab2 100644 --- a/util.c +++ b/util.c @@ -1898,7 +1898,7 @@ void cgsem_post(cgsem_t *cgsem) int ret; ret = write(cgsem->pipefd[1], &buf, 1); - if (ret == 0) + if (unlikely(ret == 0)) quit(1, "Failed to write in cgsem_post"); } @@ -1908,7 +1908,7 @@ void cgsem_wait(cgsem_t *cgsem) int ret; ret = read(cgsem->pipefd[0], &buf, 1); - if (ret == 0) + if (unlikely(ret == 0)) quit(1, "Failed to read in cgsem_wait"); }