From patchwork Mon Oct 26 16:47:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Doucha X-Patchwork-Id: 1387897 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.cz Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CKgm26yJSz9sSW for ; Tue, 27 Oct 2020 03:49:22 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 0667F3C269C for ; Mon, 26 Oct 2020 17:49:20 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [217.194.8.2]) by picard.linux.it (Postfix) with ESMTP id 07B7D3C247A for ; Mon, 26 Oct 2020 17:48:06 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-2.smtp.seeweb.it (Postfix) with ESMTPS id AFA416008B5 for ; Mon, 26 Oct 2020 17:48:06 +0100 (CET) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 1AD76ACD8 for ; Mon, 26 Oct 2020 16:48:06 +0000 (UTC) From: Martin Doucha To: ltp@lists.linux.it Date: Mon, 26 Oct 2020 17:47:53 +0100 Message-Id: <20201026164756.30556-17-mdoucha@suse.cz> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201026164756.30556-1-mdoucha@suse.cz> References: <20201026164756.30556-1-mdoucha@suse.cz> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-2.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.0 required=7.0 tests=SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-2.smtp.seeweb.it Subject: [LTP] [PATCH 16/19] Unify error handling in include/tst_safe_posix_ipc.h X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" - Properly format caller file:line location Signed-off-by: Martin Doucha --- include/tst_safe_posix_ipc.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/tst_safe_posix_ipc.h b/include/tst_safe_posix_ipc.h index d74ef4ee8..b60c12c9e 100644 --- a/include/tst_safe_posix_ipc.h +++ b/include/tst_safe_posix_ipc.h @@ -36,9 +36,11 @@ static inline int safe_mq_open(const char *file, const int lineno, va_end(ap); rval = mq_open(pathname, oflags, mode, attr); + if (rval == -1) { - tst_brk(TBROK | TERRNO, "%s:%d: mq_open(%s,%d,0%o,%p) failed", - file, lineno, pathname, oflags, mode, attr); + tst_brk_(file, lineno, TBROK | TERRNO, + "mq_open(%s,%d,%04o,%p) failed", pathname, oflags, + mode, attr); } return rval;