From patchwork Wed Jan 22 15:54:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 313285 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id ADF702C00AF for ; Thu, 23 Jan 2014 02:54:57 +1100 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1W608l-0000yO-Nx; Wed, 22 Jan 2014 15:54:55 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1W608g-0000yB-6f for fwts-devel@lists.ubuntu.com; Wed, 22 Jan 2014 15:54:50 +0000 Received: from cpc3-craw6-2-0-cust180.croy.cable.virginm.net ([77.100.248.181] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1W608g-0000sX-48 for fwts-devel@lists.ubuntu.com; Wed, 22 Jan 2014 15:54:50 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH] fwts_exec: fix status check (LP: #1271607) Date: Wed, 22 Jan 2014 15:54:49 +0000 Message-Id: <1390406089-14016-1-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 1.8.5.3 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: fwts-devel-bounces@lists.ubuntu.com From: Colin Ian King fix inverted status check of exec calls. This is causing uefi tests to fail because of module load/unload is erroneously being reported to fail when it is in fact succeeding. Signed-off-by: Colin Ian King Acked-by: Alex Hung Acked-by: Ivan Hu --- src/lib/src/fwts_pipeio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/src/fwts_pipeio.c b/src/lib/src/fwts_pipeio.c index 1f21ed7..df07295 100644 --- a/src/lib/src/fwts_pipeio.c +++ b/src/lib/src/fwts_pipeio.c @@ -179,7 +179,8 @@ int fwts_exec(const char *command, int *status) if ((fd = fwts_pipe_open(command, &pid)) < 0) return FWTS_ERROR; - if (!(*status = fwts_pipe_close(fd, pid))) + *status = fwts_pipe_close(fd, pid); + if (*status) return FWTS_EXEC_ERROR; return FWTS_OK; }