From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5716 invoked by alias); 3 Mar 2011 18:46:19 -0000 Received: (qmail 5707 invoked by uid 22791); 3 Mar 2011 18:46:17 -0000 X-SWARE-Spam-Status: No, hits=-5.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-outbound-2.vmware.com (HELO smtp-outbound-2.vmware.com) (65.115.85.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 03 Mar 2011 18:46:10 +0000 Received: from mailhost4.vmware.com (mailhost4.vmware.com [10.16.67.124]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id A69E94100C; Thu, 3 Mar 2011 10:46:09 -0800 (PST) Received: from msnyder-server.eng.vmware.com (promd-2s-dhcp138.eng.vmware.com [10.20.124.138]) by mailhost4.vmware.com (Postfix) with ESMTP id 9BE72C9E83; Thu, 3 Mar 2011 10:46:09 -0800 (PST) Message-ID: <4D6FE1F1.1010501@vmware.com> Date: Thu, 03 Mar 2011 18:46:00 -0000 From: Michael Snyder User-Agent: Thunderbird 2.0.0.24 (X11/20101201) MIME-Version: 1.0 To: nickc@redhat.com, rth@redhat.com, bug-binutils@gnu.org, "gdb-patches@sourceware.org" Subject: [RFA] archive.c, bsd_write_armap, fail if stat fails Content-Type: multipart/mixed; boundary="------------010503030402050608050706" X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-03/txt/msg00201.txt.bz2 This is a multi-part message in MIME format. --------------010503030402050608050706 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 41 Perhaps nit-picky -- what do you think? --------------010503030402050608050706 Content-Type: text/plain; name="archive.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="archive.txt" Content-length: 797 2011-03-03 Michael Snyder * archive.c (bsd_write_armap): Fail if stat fails. Index: archive.c =================================================================== RCS file: /cvs/src/src/bfd/archive.c,v retrieving revision 1.72 diff -u -p -u -p -r1.72 archive.c --- archive.c 28 Feb 2011 18:30:16 -0000 1.72 +++ archive.c 3 Mar 2011 18:40:54 -0000 @@ -2304,7 +2304,11 @@ bsd_write_armap (bfd *arch, firstreal = mapsize + elength + sizeof (struct ar_hdr) + SARMAG; - stat (arch->filename, &statbuf); + if (stat (arch->filename, &statbuf) != 0) + { + bfd_set_error (bfd_error_system_call); + return FALSE; + } if ((arch->flags & BFD_DETERMINISTIC_OUTPUT) == 0) { /* Remember the timestamp, to keep it holy. But fudge it a little. */ --------------010503030402050608050706--