From patchwork Wed Apr 17 20:20:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Alcock X-Patchwork-Id: 88616 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D40E63849AF2 for ; Wed, 17 Apr 2024 20:27:48 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id 6146F384AB5E for ; Wed, 17 Apr 2024 20:21:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6146F384AB5E Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oracle.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6146F384AB5E Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1713385311; cv=pass; b=sWTk0n72/x42PqaXYfxO4JnDLtO+yT8vX+Pn+y4QWaAc4tdO3zP4ljFuFNMD377vS7baUut34VxYTFMtVwgP/TyMJcYC/zJNPIAqN0gcJkt2Setz0TXWMeSgxzI8GGPk0vH11vFmequIE91JIZIw8zNXp92brW98Ym2XE22TGic= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1713385311; c=relaxed/simple; bh=co6hpfNJbxiE7Wz367zxY8YoZ4pHTrTKIAlBdNckj8M=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=tsFMxKpnqrPp9h873Ooz0Ueno78KjxdkCvTVqDQkKCNvDakzuLZLffik+BvObqdKjHzjMPGCaQ6kLD81XZ9Ea402cG0Ke9lTBdJQcQdzre8AOzT43/pWP59BNONoXsxnUsfk4ECIyMx8i1rBWcPEj9MUuZ9KwpjDWMZxqHsC/wk= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 43HHhqHU025919 for ; Wed, 17 Apr 2024 20:21:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=Nt1jiL/4XgetQk+5sCERzUhsf2GiVTv9j8KHmbk01MY=; b=GeNW3eUyYVMYiIXIk1jBQQbNppia48gLZ6K72rF8CpHVYvZSZwCc46FFsXSH4LguwLcs /Tow/4ULR4WgUQOF9wreBmxEmaNcNlODDolhVXp3ebgPzY0r3y02C62fPaLQVr8ihfvV Ui03Ey8ty9VwJbE5AffMSqmXLL4K6tiB919Zmb1THJFDSDCxPRZ8SAb1ZmQLQHq7as02 u5vdefNtYeexjWZ5efyeXNtEWJv6bypnzsLX3JEU4v8YlHKTm3tSWvI/67qcSJVTycWY 6naMt7SFI1WBIZrhDcxTb1mmGWuKzy3BWLNEGnhTon2yCTga/KqkjzIrh0SHElCX4KGm fA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3xfhnugx4w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 17 Apr 2024 20:21:48 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 43HJWdJt012600 for ; Wed, 17 Apr 2024 20:21:47 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2169.outbound.protection.outlook.com [104.47.56.169]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3xgkwhfeyd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 17 Apr 2024 20:21:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GYt+ytOUo03gQtWpjikbsM/s5Qg5h1NtbQQhskiEwgXppW5IpS1ZDX6AHRZWkbKeY6wuxo/n3RC1VWZZYTDN14AMori7lEihf8e0hqll9kK68n+kZFJpc9iIS+VICChTpsnMJQ4pyApkEOlZTFgQXkjTtaP4kWXX+deGKg2nx+JefY+/pScSSrS/Ex9k67J8isd0iAMCPZq1UVib2TT3f1sugIi+JrySuqLiTzeSJd5cdbgoNi8MnVlu+Ouaea+DAQ+jwt1xVOciag15/5sQsgxbYWiWwy4BeHOgcw/W4L6eXXxJYTYiUJxPho0nmMZAIhcCSqUxdP2cl45lrw8BbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Nt1jiL/4XgetQk+5sCERzUhsf2GiVTv9j8KHmbk01MY=; b=Am90sSARGkfpBOulJWUZ7kT5hYrndGX+UxoCJdG3Y+Da1TmnLps6ljY69Z68ku1efdlfT64QeloH45EjEn7gUzdcAFq1dZ9U1QqQYArG+F5DPq5VifBr6lXEn5hsHnkiPbWcYN5K8+lvuTMYILjT12C9znCDh8P2o5UpjBhvlyapmNgykjQgGNwhHOb1Yna4FhEP50p86RzrPffrI2kWwzc9Ndzy4n8GU/10iPPnZMarxJ/5oOCBU2WlsJZh6jedhqLj3K+YPNqwKrUmlGHbDVgOLhtSIXrC8qWyz5iT61u446kzBur2EEQYzo4b6Pzd5PPbFAODO16mwi+bDedC2g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Nt1jiL/4XgetQk+5sCERzUhsf2GiVTv9j8KHmbk01MY=; b=Sw++BCYMAuz69SxcoztrkmwD0JpfuWqHgbvMUVY5vinSg7O/KcGR1vaHA7XunOyZQGAYnTBwP9CghPsYwMpnrpxfTIur5mzPTF6JH4jEABPU8dgL/+lo8134ByMA47IdOdFsJpiaYFDU+nzZGd9pKnk6UEdlQhbMjYLYsG2rces= Received: from MW4PR10MB6608.namprd10.prod.outlook.com (2603:10b6:303:22e::8) by MW4PR10MB6678.namprd10.prod.outlook.com (2603:10b6:303:22c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.50; Wed, 17 Apr 2024 20:21:45 +0000 Received: from MW4PR10MB6608.namprd10.prod.outlook.com ([fe80::67a4:9544:7249:7751]) by MW4PR10MB6608.namprd10.prod.outlook.com ([fe80::67a4:9544:7249:7751%7]) with mapi id 15.20.7472.037; Wed, 17 Apr 2024 20:21:44 +0000 From: Nick Alcock To: binutils@sourceware.org Subject: [PATCH 20/22] libctf: don't pass errno into ctf_err_warn so often Date: Wed, 17 Apr 2024 21:20:16 +0100 Message-ID: <20240417202018.34966-21-nick.alcock@oracle.com> X-Mailer: git-send-email 2.44.0.273.ge0bd14271f In-Reply-To: <20240417202018.34966-1-nick.alcock@oracle.com> References: <20240417202018.34966-1-nick.alcock@oracle.com> X-ClientProxiedBy: LO4P265CA0137.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2c4::15) To MW4PR10MB6608.namprd10.prod.outlook.com (2603:10b6:303:22e::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MW4PR10MB6608:EE_|MW4PR10MB6678:EE_ X-MS-Office365-Filtering-Correlation-Id: 3ef41d06-67b6-4803-1fd7-08dc5f1c001d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: S7My8HOiUVU/03NRly8BI707OSWiUvmjDpJwgNZC90CGQT5R3Ae6nJbm3dB2F9rxrs0cebgGXOtcYGVgmw8rUvx6WzknpadBjdEcwt4/tDxAZINbRmZcK2t4eIZkjsk0O3oPh2rlwKSHYZNg6gu0WzULEX8ri0mr2fnuTDPhrMW0TsVWo08rbZkE0lDUuMJafwHXGUUa1oMQ1EzakXaKx+nxU5Y8uocbV38/3kLebNunUF1x2SsFqIGaxZHDb/6x9+QThQoQlb7rVfORPMW0GsJz/iW4TB5xgWTG1veTbnMwNA/nNP4NIsLpfOAqzQEKuR7IDaqgjIxEerfLCLIAVlI3C5tm3Va7cCUwmDhmc4JuPkNXIfqsfycShy6y2pYwoMvZlAqKbHCSOuzG07euzO59ld/7pUoqkRiMZ+s4AEUZ4i2QeMAL/bOoIim/F+PIxUaGtKQ5EsSKa45kwu+QoLVLUl8OYmAecrkXQu3CT4nj+qmx9wfBTrcIErFk2D8kse60Tk2xN6TG9T0EOGWx950YArLLMEkdsk878jY8+WnAQw592T22abLjPRkwrfdCT04l5XKF/GEmRsStee9BSxX5cM5uOVU9QLoo4BalwmKQaAtgQLiMc7ZVdWIFRoelTU74OcirDYMT6kqeyuJnPjo6ahRGqyppjifu5ueOKCY= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW4PR10MB6608.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366007)(376005)(1800799015); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7RA4nWkc1agj3i3kNrcqG24gXOPY2hrmI6nrFNv06X3ffMTfDpyEwlOsjLNlQr0qlGgA68wAMGz2kxiKsG8i7OJUvptQwAGIeGAeO0mmPzCoZXwWKH4oSwtQrC8K+9ca82js+lzQv1nQuGx+gY75aB3sXF8ULaU80pNG0LjTWIwImMCSuUjhghfj5aemGLw3LotXXwC4Tyb+tOfAfasaNxfzabJ/xsh2nW7Ajr9L8ZM+fkuzNhzjodFf+aJtMKrkDr7PLP5c7JREsjns+yi71+nhf4Yc098EgIcEpMy3BekCtkcquIZ63a/mx1MKxeHYTZolnFw71qZWO8JuItmY/MJUEytksY4+b5oJvSfaU4Kuyy2AJw5c78bvHqOTE9vOe4vc455qsAO+QW/PnHzm0sSrjpL9Lr87ijpSYaYJLN057f1ZSmLZk60JdoZXcij29mfij+pDUvFCku6rnjq+CW/6T0/p+K3nKVSg725nO5OsrkVFYu59LH6PvQ9G4kuF5m9YmL10tSQa9OOI1JacqhkMJJwyQC/NKX2gFNRi/VMaqGavUuO3GSTR6OO+hnpIhDwqockEgcAttM3rtN0nN0cqoSyHfPRhLoRHn+pPHs3hJasaze+BegAzmRDYXF2FgNIRUhJXAvbkl1cg1oPWVJ5Ye+GaYGtD//xxTSASU4QCvDPtHM0NxHWOfCRSudADS+gwFc3AljQk2O9sAZ8ZCnlIXSPvt1X5uGRtUlE+zTkjMm84Ch1ZzaS5Cz94pKPBLMrCHFZZQKVG9JtUfek5nHCU0Wx2V01AOqjOFSrtBGmVdozA5bXj8YiZRLf0HXUypqaiu5EKnzcuQI2swLe7f5iSOqMzHDS26Ps/13yQ9DMWpj1MVKn19ei7cmdjp/unJr6htso8/i3a3U0JwPL/29vYcLhx5uWkCgSTaC1ABQX2Dodot5RupNoafnA+IiO3u9D50vCcZrsbv/UtwO3uGD0qEN8f3t4CpZyZEKic48yzAh1fyKcilGyQzv94mZeQmWTTcqp1eKEkFhUTotYGLPHeQtVx2u9WkHoryqyLNw8RHmLcJIIoEBYD/3D0eY5nervwrhoRudlu7pb0dkBe/yf1lZfb4cLMDB3z3fyXcrU9Fscprk0hNNYMVdEIRuUfhA/VI1drPqJ1JXYHVKsq5A5mI/Cj1zyBYJ5b/3a7XGJmRip6UwfrQjAqr1FGdA+rTBQrgsCBK0mfWrl4KQklTnJ/DMqtwLWOSpfjC5z7cf8OVVb9XEw50ueGQGEowMLXp4CYzksclZxgRLSGHVmGkL1nGKcQd21dxv3TpRUogGbkSSGiqc9o9KKMr14qk2s0Uuc+4UbRZck9fCo/6lDkKQdz78JLg6i8Io+0Z+t5cUOui2pXxn+OqqLiHbhRVxPqXpfDFGQQAgqiKQIDtf1J/OFyfIaG2cEPPLtijEcjCyjsASbz57YEyGocTntvrZ7qsRHjuaaavzDmqOh9P/Hps9FtpmaJoM5Fps2rtxzTKrfVrYYLuiLrdWSNVJvEg53zFCOOZSXBpL8nq+KjAmvi7ekCoiA7ZrzBsRRZwzRF+U83s+mLkNy4mCxkIyQh2F+uXmCR0et2gtKBTI67GUFNZw== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: nrnKP3G+DrZ25u4YQ3ej/uhzuW2guX2piv66PqEjpDoXLV6dh5XWMCAAz9WfUQmThMDIJWLkPTDSdnME4miiMxjHRRhmGqFpHGsXeq9TIAU/4PCyCXdvHHwrECLxYwC/+flkXCbrRqCj3fbebLZjccDHRWbQlQK26JnquvCoIUuY841+VjsfpNjOJi4ZSCinAzl0gOxBngop/KWaHD9ZZd7L+bGvGpBIptBUxtNnGw5HgN6x3P8mVF1lOl2wHvWCtns1qNsTCv47VKEVEN4zSa7jXdcWPzfJ38MkgXIQ7Q72JzBuehE2NySQZ8pxspFBu0Hny/YNkKEmLX0L4+yf3O495zywuFLIpkFRUW2ydSmrhaCF5qX3T3DCG2dpqQPPuCuAVQNCkoubE+PvAdT4CpgP4LdvxKki8Joue4ubxNPU2To6J8DvJZ3iEF5JXYiUY+ENZHNe5by5D21b5+iuON9ntZeo2B4CcgzaHiZSOr877KTM9P04uhTTn+F5ZPxr7iMxcIk9KfeJS/7TFz9hcxL3MC1uhiCsGHA/3j3bqm8xFB0pR3SLYiBOTwKVuDlFAK10Fkj+ooQJsXYkAWJBusVEBGzY1gWspklMgxVBxG8= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ef41d06-67b6-4803-1fd7-08dc5f1c001d X-MS-Exchange-CrossTenant-AuthSource: MW4PR10MB6608.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Apr 2024 20:21:44.7621 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: PGjJa3yluYKdddJUB+VVZIuyM3EaXHUgwUpYuGcwEOYkPHsKSocMaJt3hSKDyj5xWBL+t4Jj0oh+vZEpR1MqyA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR10MB6678 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-17_17,2024-04-17_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 mlxlogscore=999 suspectscore=0 adultscore=0 phishscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2404170143 X-Proofpoint-GUID: fam6TKKRWdzYPfc2uyFfGiTjRIlBc4xV X-Proofpoint-ORIG-GUID: fam6TKKRWdzYPfc2uyFfGiTjRIlBc4xV X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+patchwork=sourceware.org@sourceware.org The libctf-internal warning function ctf_err_warn() can be passed a libctf errno as a parameter, and will add its textual errmsg form to the passed-in error message. But if there is an error on the fp already, and this is specifically an error and not a warning, ctf_err_warn() will print the error out regardless: there's no need to pass in anything but 0. There are still a lot of places where we do ctf_err_warn (fp, 0, EFOO, ...); return ctf_set_errno (fp, 0, EFOO); I've left all of those alone, because fixing it makes the code a bit longer: but fixing the cases where no return is involved and the error has just been set on the fp itself costs nothing and reduces redundancy a bit. libctf/ * ctf-dedup.c (ctf_dedup_walk_output_mapping): Drop the errno arg. (ctf_dedup_emit): Likewise. (ctf_dedup_type_mapping): Likewise. * ctf-link.c (ctf_create_per_cu): Likewise. (ctf_link_deduplicating_close_inputs): Likewise. (ctf_link_deduplicating_one_symtypetab): Likewise. (ctf_link_deduplicating_per_cu): Likewise. * ctf-lookup.c (ctf_lookup_symbol_idx): Likewise. * ctf-subr.c (ctf_assert_fail_internal): Likewise. --- libctf/ctf-dedup.c | 8 ++++---- libctf/ctf-link.c | 22 +++++++++++----------- libctf/ctf-lookup.c | 4 ++-- libctf/ctf-subr.c | 4 ++-- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/libctf/ctf-dedup.c b/libctf/ctf-dedup.c index dc7a1cf79e2..c7db6ab4965 100644 --- a/libctf/ctf-dedup.c +++ b/libctf/ctf-dedup.c @@ -2398,8 +2398,8 @@ ctf_dedup_walk_output_mapping (ctf_dict_t *output, ctf_dict_t **inputs, } if (err != ECTF_NEXT_END) { - ctf_err_warn (output, 0, err, _("cannot recurse over output mapping")); ctf_set_errno (output, err); + ctf_err_warn (output, 0, 0, _("cannot recurse over output mapping")); goto err; } ctf_dynset_destroy (already_visited); @@ -3092,9 +3092,9 @@ ctf_dedup_emit (ctf_dict_t *output, ctf_dict_t **inputs, uint32_t ninputs, if ((outputs = calloc (num_outputs, sizeof (ctf_dict_t *))) == NULL) { - ctf_err_warn (output, 0, ENOMEM, - _("out of memory allocating link outputs array")); ctf_set_errno (output, ENOMEM); + ctf_err_warn (output, 0, 0, + _("out of memory allocating link outputs array")); return NULL; } *noutputs = num_outputs; @@ -3146,7 +3146,7 @@ ctf_dedup_type_mapping (ctf_dict_t *fp, ctf_dict_t *src_fp, ctf_id_t src_type) else { ctf_set_errno (fp, ECTF_INTERNAL); - ctf_err_warn (fp, 0, ECTF_INTERNAL, + ctf_err_warn (fp, 0, 0, _("dict %p passed to ctf_dedup_type_mapping is not a " "deduplicated output"), (void *) fp); return CTF_ERR; diff --git a/libctf/ctf-link.c b/libctf/ctf-link.c index 44d4e496f6a..801b6ee599d 100644 --- a/libctf/ctf-link.c +++ b/libctf/ctf-link.c @@ -330,9 +330,9 @@ ctf_create_per_cu (ctf_dict_t *fp, ctf_dict_t *input, const char *cu_name) if ((cu_fp = ctf_create (&err)) == NULL) { - ctf_err_warn (fp, 0, err, _("cannot create per-CU CTF archive for " - "input CU %s"), cu_name); ctf_set_errno (fp, err); + ctf_err_warn (fp, 0, 0, _("cannot create per-CU CTF archive for " + "input CU %s"), cu_name); return NULL; } @@ -886,9 +886,9 @@ ctf_link_deduplicating_close_inputs (ctf_dict_t *fp, ctf_dynhash_t *cu_names, } if (err != ECTF_NEXT_END) { - ctf_err_warn (fp, 0, err, _("iteration error in deduplicating link " - "input freeing")); ctf_set_errno (fp, err); + ctf_err_warn (fp, 0, 0, _("iteration error in deduplicating link " + "input freeing")); } } else @@ -1087,8 +1087,8 @@ ctf_link_deduplicating_one_symtypetab (ctf_dict_t *fp, ctf_dict_t *input, if (ctf_errno (input) != ECTF_NEXT_END) { ctf_set_errno (fp, ctf_errno (input)); - ctf_err_warn (fp, 0, ctf_errno (input), - functions ? _("iterating over function symbols") : + ctf_err_warn (fp, 0, 0, functions ? + _("iterating over function symbols") : _("iterating over data symbols")); return -1; } @@ -1156,9 +1156,9 @@ ctf_link_deduplicating_per_cu (ctf_dict_t *fp) if (labs ((long int) ninputs) > 0xfffffffe) { - ctf_err_warn (fp, 0, EFBIG, _("too many inputs in deduplicating " - "link: %li"), (long int) ninputs); ctf_set_errno (fp, EFBIG); + ctf_err_warn (fp, 0, 0, _("too many inputs in deduplicating " + "link: %li"), (long int) ninputs); goto err_open_inputs; } @@ -1180,10 +1180,10 @@ ctf_link_deduplicating_per_cu (ctf_dict_t *fp) &ai, NULL, 0, &err); if (!only_input->clin_fp) { - ctf_err_warn (fp, 0, err, _("cannot open archive %s in " - "CU-mapped CTF link"), - only_input->clin_filename); ctf_set_errno (fp, err); + ctf_err_warn (fp, 0, 0, _("cannot open archive %s in " + "CU-mapped CTF link"), + only_input->clin_filename); goto err_open_inputs; } ctf_next_destroy (ai); diff --git a/libctf/ctf-lookup.c b/libctf/ctf-lookup.c index 1b1ebedc4b7..e4d18bec112 100644 --- a/libctf/ctf-lookup.c +++ b/libctf/ctf-lookup.c @@ -665,8 +665,8 @@ ctf_lookup_symbol_idx (ctf_dict_t *fp, const char *symname, int try_parent, } oom: ctf_set_errno (fp, ENOMEM); - ctf_err_warn (fp, 0, ENOMEM, _("cannot allocate memory for symbol " - "lookup hashtab")); + ctf_err_warn (fp, 0, 0, _("cannot allocate memory for symbol " + "lookup hashtab")); return (unsigned long) -1; } diff --git a/libctf/ctf-subr.c b/libctf/ctf-subr.c index ecc68848d31..deb9e0ba5c4 100644 --- a/libctf/ctf-subr.c +++ b/libctf/ctf-subr.c @@ -340,7 +340,7 @@ void ctf_assert_fail_internal (ctf_dict_t *fp, const char *file, size_t line, const char *exprstr) { - ctf_err_warn (fp, 0, ECTF_INTERNAL, _("%s: %lu: libctf assertion failed: %s"), - file, (long unsigned int) line, exprstr); ctf_set_errno (fp, ECTF_INTERNAL); + ctf_err_warn (fp, 0, 0, _("%s: %lu: libctf assertion failed: %s"), + file, (long unsigned int) line, exprstr); }