From patchwork Tue Oct 27 11:50:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 536574 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A48FE141324 for ; Tue, 27 Oct 2015 22:50:43 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=cqQLzVfG; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=RYFjvENwvrKiFlPcppdEHgMT35lkk1LPeL/DKf89+02Obn2vSP zyx3lPlJl7bRrtbQipL7W7dGMB6B0kgH+nJ0HoNzw70DX2a3zqTJ2LhSooI3i75L Xb3H2OWS8Blm1AiOlii3VvVkjp44O2Bd4fN0jYuExDlhWjhEpCWdpVAFw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=hghJ/6LUtlw6VOv61E3MeZTJUE0=; b=cqQLzVfG/gog776rJ7S+ 6S5mhSBGBjww9wMfj4Vrj8D4UpLrW3sdKw5LqNg8kxdOo9bcLa8D3pDyulWk7oPw MSfRxabn4b9wvQJ80BNhqKBnvDvFD81osqnTla5P7ObwoVExTXrNnx8qgTeWCTtN ykSVSYdvQbTF9D/cgjE5Si8= Received: (qmail 54419 invoked by alias); 27 Oct 2015 11:50:36 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 54406 invoked by uid 89); 27 Oct 2015 11:50:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.1 required=5.0 tests=AWL, BAYES_50, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 27 Oct 2015 11:50:35 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 61AFD11826F; Tue, 27 Oct 2015 07:50:33 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id EtUScstoLQCL; Tue, 27 Oct 2015 07:50:33 -0400 (EDT) Received: from tron.gnat.com (tron.gnat.com [205.232.38.10]) by rock.gnat.com (Postfix) with ESMTP id 51FD611826A; Tue, 27 Oct 2015 07:50:33 -0400 (EDT) Received: by tron.gnat.com (Postfix, from userid 4192) id 4DEF6184; Tue, 27 Oct 2015 07:50:33 -0400 (EDT) Date: Tue, 27 Oct 2015 07:50:33 -0400 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Vincent Celier Subject: [Ada] Delete response file even when link failed Message-ID: <20151027115033.GA46928@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) When a response file was created and the link failed, the response file was not deleted. It is deleted now. Tested on x86_64-pc-linux-gnu, committed on trunk 2015-10-27 Vincent Celier * gnatlink.adb: Always delete the response file, even when the invocation of gcc to link failed. Index: gnatlink.adb =================================================================== --- gnatlink.adb (revision 229413) +++ gnatlink.adb (working copy) @@ -1859,6 +1859,10 @@ -- been compiled. if Opt.CodePeer_Mode then + if Tname_FD /= Invalid_FD then + Delete (Tname); + end if; + return; end if; @@ -2052,16 +2056,14 @@ System.OS_Lib.Spawn (Linker_Path.all, Args, Success); - if Success then + -- Delete the temporary file used in conjunction with linking if one + -- was created. See Process_Bind_File for details. - -- Delete the temporary file used in conjunction with linking - -- if one was created. See Process_Bind_File for details. + if Tname_FD /= Invalid_FD then + Delete (Tname); + end if; - if Tname_FD /= Invalid_FD then - Delete (Tname); - end if; - - else + if not Success then Error_Msg ("error when calling " & Linker_Path.all); Exit_Program (E_Fatal); end if;