From nobody Sat Feb 7 07:15:20 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 152207170836690.02688369375153; Mon, 26 Mar 2018 06:41:48 -0700 (PDT) Received: from localhost ([::1]:56822 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0SNf-0002EF-EX for importer@patchew.org; Mon, 26 Mar 2018 09:41:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0SIw-0006UJ-E0 for qemu-devel@nongnu.org; Mon, 26 Mar 2018 09:36:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0SIr-0006rJ-Ey for qemu-devel@nongnu.org; Mon, 26 Mar 2018 09:36:54 -0400 Received: from mail-wr0-x22f.google.com ([2a00:1450:400c:c0c::22f]:46543) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f0SIr-0006r0-81 for qemu-devel@nongnu.org; Mon, 26 Mar 2018 09:36:49 -0400 Received: by mail-wr0-x22f.google.com with SMTP id d1so6939212wrj.13 for ; Mon, 26 Mar 2018 06:36:49 -0700 (PDT) Received: from 640k.lan (94-36-194-48.adsl-ull.clienti.tiscali.it. [94.36.194.48]) by smtp.gmail.com with ESMTPSA id g186sm6710105wmd.41.2018.03.26.06.36.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Mar 2018 06:36:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=VHUt9S1BX01kEGXKbhiG/gc2MO2GLXfPnTZEgdvmnXY=; b=UKAy2uxiVT6RG1E2FCsDQIg4KJIudHS3JzFsPS7cc2HJZsT9zr4zwD61XYCZa6X9SI atPUWti4I1tfxFMedmZds0anlX7tLzlSzlmlvl6MlKI6KBN9nnWlKRJSdL1Efa7Zi9jG icaRHW4r3c9esX25GwliIuJqFK5lzLLkmPewnVnmz596pfwxE22LZ7S3L+2YBadA1cCc nNcp0hS0IRdP6Vc7Izro9yFxoZixk9ziSBhPBGBmaOQZpWSa4tdrFsB5mRu8JibExSLw n1TGDJb8VEuXG8s/Ygm5yBszYePaWz9gPHN0IjAyna5z+tV9aaZMgtYOHHCL2gKYoFyt SvOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=VHUt9S1BX01kEGXKbhiG/gc2MO2GLXfPnTZEgdvmnXY=; b=MZAw0QYXtsZ0dOC7s+2CpjVoCI43gPZswr2e3QHIbQ+NrAD1s2BvNZNRu15Kn1I0Jv dv6Nak8OepdEB3p1IYBsG0AiwIVgIVRUldIBLqd7pG4MO/lN8jMsFFGAXxUGMNwS4K3D J7BAhgqWbfESKXeWRtCrHie0LYLmENVg0/1jH3lDzlboBcYU6yj9voVwVlppeuZA1W/P b54XxIibRnR/kCqP+ha7j4HnpGxjCegIX4sEu6DiIrThYrdt7tp+Tx/H+PFT7hD/+52N eHlBkWOxJ2/4sPh7qsfRY4qitADef57Yup2ySNdry66gauQYKxkPB6ZjKD9L38E3Y0eh uixw== X-Gm-Message-State: AElRT7F+F4LW6qAB+HokyAWY3WQmVJBn142UUk73laHtx2C2TDfz2pd2 hkPe8tCvOfS6lggn5+VbsUOCHnHv X-Google-Smtp-Source: AG47ELuB9eGmiwjE+bWWR4MxlwfmDtFxW46gK6l/fXLsV3YTc+JUwRYOP8kBZALtU5xat4Fx72wivw== X-Received: by 10.223.173.197 with SMTP id w63mr33326555wrc.83.1522071407673; Mon, 26 Mar 2018 06:36:47 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 26 Mar 2018 15:36:28 +0200 Message-Id: <1522071403-52486-2-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1522071403-52486-1-git-send-email-pbonzini@redhat.com> References: <1522071403-52486-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::22f Subject: [Qemu-devel] [PULL 01/16] scripts/get_maintainer.pl: Print proper error message for missing $file X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Thomas Huth , Stefano Stabellini , Ian Jackson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Ian Jackson If you pass scripts/get_maintainer.pl the name of a FIFO or other exciting object (/dev/stdin, for example), it would falsely print "file not found". Instead: stat the object rather than using -f so that we do not mind if the object is not a file; and print the errno value in the error message. Signed-off-by: Ian Jackson CC: Thomas Huth CC: Paolo Bonzini CC: Stefano Stabellini CC: Anthony PERARD Message-Id: <1520535787-6223-13-git-send-email-ian.jackson@eu.citrix.com> Signed-off-by: Paolo Bonzini Signed-off-by: Ian Jackson --- scripts/get_maintainer.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index 07369aa..43fb5f5 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl @@ -381,8 +381,8 @@ foreach my $file (@ARGV) { ##if $file is a directory and it lacks a trailing slash, add one if ((-d $file)) { $file =3D~ s@([^/])$@$1/@; - } elsif (!(-f $file)) { - die "$P: file '${file}' not found\n"; + } elsif (!(stat $file)) { + die "$P: file '${file}' not found: $!\n"; } } if ($from_filename) { --=20 1.8.3.1