From patchwork Mon Oct 9 21:34:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Koenig X-Patchwork-Id: 823533 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-463828-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="JAdc5xY9"; dkim-atps=neutral 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 3y9tnK01ljz9t5Q for ; Tue, 10 Oct 2017 08:34:59 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=XonFYOEotKK7V++7MMS8eDwyGjZGaJAvsBRNHomklWuNS+bP5z CrNqfkDdedSn/Sf/KIPCzdaoduCrkNfMr8DWJNIBWdDxjn67rPnPI2debbc7D95x 3v4sfuJcaMoEnYb3xQc9CQBg7xHSSWB8g3ci7hWyACnxaunXsq6ZXj7YM= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=3HU8NXkKnskxfgzGU+vcVuKrWFg=; b=JAdc5xY9a/BrJskeApUe UwLZ/JAThZbcPDE19PWSb8VPBfmcyUqajBk75An/YVLS2LQAv96rlj4qJmHjWUXI lWrcDHhX0VED3Vp0Ik9cJ1934rPH00g9z2qNuyqNfl4EGRRHur1UDu6G1nwFbBwZ EalxwhNUA0nry6VAuR7ow4o= Received: (qmail 102859 invoked by alias); 9 Oct 2017 21:34:51 -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 102830 invoked by uid 89); 9 Oct 2017 21:34:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=H*M:d602, H*MI:d602, Urban, urban X-Spam-User: qpsmtpd, 2 recipients X-HELO: cc-smtpout3.netcologne.de Received: from cc-smtpout3.netcologne.de (HELO cc-smtpout3.netcologne.de) (89.1.8.213) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Oct 2017 21:34:49 +0000 Received: from cc-smtpin3.netcologne.de (cc-smtpin3.netcologne.de [89.1.8.203]) by cc-smtpout3.netcologne.de (Postfix) with ESMTP id 81D7D124D3; Mon, 9 Oct 2017 23:34:44 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cc-smtpin3.netcologne.de (Postfix) with ESMTP id 7401D11DDB; Mon, 9 Oct 2017 23:34:44 +0200 (CEST) Received: from [78.35.132.98] (helo=cc-smtpin3.netcologne.de) by localhost with ESMTP (eXpurgate 4.1.9) (envelope-from ) id 59dbeb74-02b7-7f0000012729-7f00000191e7-1 for ; Mon, 09 Oct 2017 23:34:44 +0200 Received: from [192.168.178.20] (xdsl-78-35-132-98.netcologne.de [78.35.132.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by cc-smtpin3.netcologne.de (Postfix) with ESMTPSA; Mon, 9 Oct 2017 23:34:43 +0200 (CEST) To: "fortran@gcc.gnu.org" , gcc-patches From: Thomas Koenig Subject: [patch, libfortran] Fix EXECUTE_COMMAND_LINE error return Message-ID: <5ff7da8c-5fbb-19a7-d602-e3af3d2a12c2@netcologne.de> Date: Mon, 9 Oct 2017 23:34:42 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 Hello world, currently, EXECUTE_COMMAND_LINE aborts the program if the called program is not found, if cmdstat is present, but cmdmsg isn't. This is a 6/7/8 regression. This patch fixes the issue by simply removing the erronous call to runtime_error. Regression-tested. OK for all affected branches? Regards Thomas 2017-10-10 Thomas Koenig PR libfortran/82233 * intrinsics/execute_command_line.c (execute_command_line): No call to runtime_error if cmdstat is present. 2017-10-10 Thomas Koenig PR libfortran/82233 * gfortran.dg/execute_command_line_3.f90: New test. Index: intrinsics/execute_command_line.c =================================================================== --- intrinsics/execute_command_line.c (Revision 253525) +++ intrinsics/execute_command_line.c (Arbeitskopie) @@ -125,15 +125,9 @@ execute_command_line (const char *command, bool wa free (cmd); /* Now copy back to the Fortran string if needed. */ - if (cmdstat && *cmdstat > EXEC_NOERROR) - { - if (cmdmsg) - fstrcpy (cmdmsg, cmdmsg_len, cmdmsg_values[*cmdstat], + if (cmdstat && *cmdstat > EXEC_NOERROR && cmdmsg) + fstrcpy (cmdmsg, cmdmsg_len, cmdmsg_values[*cmdstat], strlen (cmdmsg_values[*cmdstat])); - else - runtime_error ("Failure in EXECUTE_COMMAND_LINE: %s", - cmdmsg_values[*cmdstat]); - } }