Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp368338lqo; Fri, 10 May 2024 02:19:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWWDJTIB8elL3kE379idFiPFEAySqW0AFJ33aDN8hVHubRxsm5PfoBDdkUf9GXHCG8c5yR2ipiV6m6bUTEYKysbxzv8bA8r6qv7FeK80Q== X-Google-Smtp-Source: AGHT+IF53f3lZqHg2B4rxim52+XDxEmebaWkNr0nlXoVpXQuJleCYLPJeTs2SL0apMaJIdRWUUkq X-Received: by 2002:a17:906:3194:b0:a59:9f4e:4e44 with SMTP id a640c23a62f3a-a5a2d53afa3mr202487866b.6.1715332744319; Fri, 10 May 2024 02:19:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715332744; cv=pass; d=google.com; s=arc-20160816; b=wH5242/q4zNwmq7dACZvHGzrDWYUfJKjD0oB4TzBqD2hmkLxceJJv8/8sa6ACqxELQ leuD69KAvv8Ey8foa/L8JH5/HAg6GSvjS/oADQ8uW9zKn1gW/GP/vk8eDvs7oLssihc7 RJA/TVZ0nUFJvD5k+uYQlOUkzNUG2Xxqj4VBbxs4stlM/yC9ayDKWo31q9HmO4rw0tiw UOvIZZJTYeeGiT4y/xQMfNBMunfvBL399zj5fOLo8fqcOI2j5Exgu+Igs3HECVI7tSvQ h7ZEfXbMUwgZlbRw2dEmrPdDPWbGSAqTmFo+F43leYouzispdxowmCdQ8j+mYDJtOeZc bJGg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from; bh=E6rHRo+cXnUR7eHkSHpjILcJLNOEXeIXvyNGmjbTykw=; fh=4lGQI6056MBa4/oovMyIYaKLn+Wz/24RGvUivMmQP8E=; b=ANV+ylSXqJBdkNx5/SMc4yv5QtBvnToseQh2C4Nzyve6I+/iOJewYKzwGtfDM+uKpV /pYzRdIBZFdnheCrc3xu+G7RN/vm1tDyIxaMAlZek2ZEX11ZyfdE9eR1+omgM7APZD4b x0Ik3AuFDPZBLvz3cKnywYiQElaPWjNfrQQ4mgcp4kxSBfaW8nTlbVpJvVsHBNg9LfKa SeZbxP8MRczhyQ1EGz3ZZQFLB65+svNmA1zGhSplFCrcaolcdZksCAdYaaN+sQthMXPh m0YCyDfPN1alInjCAGx+dpEK0YtGnPRAWWBbcznEa7vR4kyEERm3NuqmDDuueZnPPGa+ 7/Mw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=hadess.net); spf=pass (google.com: domain of linux-bluetooth+bounces-4458-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4458-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17b21fdesi179020466b.293.2024.05.10.02.19.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 02:19:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-4458-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=hadess.net); spf=pass (google.com: domain of linux-bluetooth+bounces-4458-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4458-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 12E751F22D82 for ; Fri, 10 May 2024 09:19:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 89FD41607A3; Fri, 10 May 2024 09:18:28 +0000 (UTC) X-Original-To: linux-bluetooth@vger.kernel.org Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 996AA165FDB for ; Fri, 10 May 2024 09:18:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715332708; cv=none; b=EPbOOjd6YBmDtku9yIgrsjGlx+iAIT8ckG07vQSxba28aJhK+02hHj9XghcZSmWiIjzs27z9m6oXKkhoc3ysSsU5lm7aDgsvch/9IszqXXiAlWEF5UGhjxetYwAO5jnOsMHo4KG2fn60BWYwxL734xDojaMnzInAkbeH0kNg5Xs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715332708; c=relaxed/simple; bh=Z4Ect0czkbLcBsbsoMl8fFiwHYkN+tVjcHoe1Tp/VkU=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lAW7H39KdeWCueR1Rm0yJG27vbijEdEIttY313fxBcySal3wzBTrz2QBfLpRHTzBPNOcVMsZ7CCVbNeuhMnHxHOQtlUn6HVRB9NHO0113LE3rE4dSGmAC412rwGmfEqxEoeaiHjx02KOVM0WLZuWywKRC2zvC6D5Xgv6W+rGccQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=hadess.net; spf=pass smtp.mailfrom=hadess.net; arc=none smtp.client-ip=217.70.183.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=hadess.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hadess.net Received: by mail.gandi.net (Postfix) with ESMTPSA id BC53D1BF213 for ; Fri, 10 May 2024 09:18:17 +0000 (UTC) From: Bastien Nocera To: linux-bluetooth@vger.kernel.org Subject: [BlueZ 12/14] isotest: Fix error check after opening file Date: Fri, 10 May 2024 11:11:10 +0200 Message-ID: <20240510091814.3172988-13-hadess@hadess.net> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240510091814.3172988-1-hadess@hadess.net> References: <20240510091814.3172988-1-hadess@hadess.net> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: hadess@hadess.net Consider "0" to be a valid fd. --- tools/isotest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/isotest.c b/tools/isotest.c index 810d15d2df2a..ddace0da3044 100644 --- a/tools/isotest.c +++ b/tools/isotest.c @@ -720,7 +720,7 @@ static int open_file(const char *filename) syslog(LOG_INFO, "Opening %s ...", filename); fd = open(filename, O_RDONLY); - if (fd <= 0) { + if (fd < 0) { syslog(LOG_ERR, "Can't open file %s: %s\n", filename, strerror(errno)); } -- 2.44.0