From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by sourceware.org (Postfix) with ESMTPS id 714D63858D28; Wed, 18 Jan 2023 20:47:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 714D63858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmx.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1674074828; bh=wFlO9NslQC41G2AWQkTcZjs/jZbLJKY7tq4fcX7cmy8=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=o0MQZiwGChLEWIJcaf4pJ9mbZSa9hLS5sfZFFTx66TP2iE3xbiN+JeXHcEJHpbGKJ tJIX6xs81iI+hf0jhUlGfmAko+CiZhJKWvmrIy8D3nIvdCgcIJg5jjRZXAcITqqMFF 7Ghm9fYnLqjzwuwZcKD0M/BsTBRg9xjZ3qgStz8mrRLT+QfrBJCiW8b8XSe33+9mCe LGSmiWb11u4eVcPyteyMYOViAPE7fZYuITqLcNSlKF4XwKc5uk17TbGhyys4dP5KqO q2WWnkR0n/SXyreKZo7ITGe2E4bD5FsBciS+1kZ4WruGoqf/Rpb7xwtmGW0e9RihTY qXgaGWGDqaWpw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.178.29] ([93.207.88.90]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M4Jqb-1pIWS23VNB-000IqU; Wed, 18 Jan 2023 21:47:07 +0100 Message-ID: Date: Wed, 18 Jan 2023 21:47:06 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [Patch] libfortran: Fix execute_command_line for Windows To: Tobias Burnus , gcc-patches , fortran Cc: NightStrike Newsgroups: gmane.comp.gcc.patches,gmane.comp.gcc.fortran References: <0b95e5f1-142e-e13a-7d77-272073e25c2a@codesourcery.com> Content-Language: en-US From: Harald Anlauf In-Reply-To: <0b95e5f1-142e-e13a-7d77-272073e25c2a@codesourcery.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:jGWu8VHRZRjbmYDPvXZdL9t+WdsnJV2XqBFs0n5Ag2r2qVAjQHb FtuDyZBo227qKa3cE/V42Ne8eVIxnLtlYvVvmTM0tDycGGehTM65XfSeS8b2fKGlCoF0HF3 wbfppzNYaDatPDyMNEKVCvUWiieMNxDs+bn5hbPTRgxJFuAXukkQc63jLDdQlmUsgx5kHvV 5s+vY4r7c0lVjH7Vh4vJg== UI-OutboundReport: notjunk:1;M01:P0:fylLPSsEgIM=;Aw2BQhnrKRayxnNmSsjTXghyYAM /KoK+xcTxYVUYHeBsDHGqCpK+1pwkwk4f8sjjesvBg35jVRbC8luC95GQ8JZ+NHPAq2q6+ioS FCy+VzkQ98Zgg9mOpniQ7O9fol4RM7MVpFZ8dWmxQtHt7B9AHbBj5YeQFXi6XHC2zn1nJv+3Y n/y2t4IwzcHn3WaQ880q+v+kfwwQ3rWQWJWfJ8tahGhHuo+QqBAey6LSu+uV+/Osqcia9ZHqi FKgeXFt6egfGGfWUVkAiNF+doNwspPPbuSpM9gce5TFpBf+r9T1dGVMEkb0GPkmTdS6nLURDM 5nwpF5d7rsVbwNyX283XulWJQsUONDitWy0q2eNhLdm0sqIv3hLE4fbdcuRMhRPRWnJLUfw3L 67vaUqVkfw9sFe01/pnBE+IK0LgVeswPdDScyMlwQJQgMXxy+trWgucIlCKzY+1hzJ5aCKb9j QnPXxduh1DL53r2XlCGsUPpPJlLRnDhC9TSRMgc+X0rkK+q9qYfvJfQ4p5DpjhF1aUgYs96Sn dGlQqE6405/OQdR3XhzDhmCU32Ij/sn891whU1Rqw0QXMGf+cevyhZjL4MWX2S4OuV42U3mHc B0+8+6g7vfdExlLNMcWCt+Ep4T0qm1J8xZfBihlluJfA+LUUKDEgykKwoYFu1kXOmKVTHMG2K RmH8PWr1bKTXWl2KnFjpAb1cIw7zm9FNnhsN58a455zFAjTmYK8jei/TBEz9HUHWoLxcGFlJb C5gw2sTKFnR3ddhlNLN8wfQFjnJ5jilZD9HDp3G9JQkhpkmVdUPAjHOMv71bRf1Mbglys/27T +HaVIkkDqUi/SK7Dz5Mb1KZR4nEsvTKOu5VbFg8YJd7ZnQsyAD62OtzGq/UFOcQeIxusnXd0y aBC5qnUdZaRvBxFqAfbeb2pFv3cj4D9v0X0p8I1D0cShTvJmfbWmECc0FGV58KErhqte8vd8G t0Smwezq8AZeh059Quuqj6Habbk= X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Tobias, Am 18.01.23 um 16:42 schrieb Tobias Burnus: > Reported by nightstrike, who also tested this patch. > > On Windows, we call system() which works as described at > https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/system= -wsystem?view=3Dmsvc-170 > > Namely, it only fails with "-1" if the command interpreter > could not be started. Otherwise, it has the return value. > (Same on Linux.) On POSIX systems, 'sh' calls exit(127) or > _exit(127) if it cannot execute the program of the passed string, > as documented. Cf. https://www.unix.com/man-page/posix/3p/system/ > > Thus, the question is what happens on Windows. Our experiments, several > webpages (like stackoverflow) and the source code of WINE for cmd.exe > indicate > that Windows returns 9009 in that case. See for instance > https://github.com/wine-mirror/wine/blob/master/programs/cmd/wcmdmain.c#= L1262-L1269 > > Thus, we now do likewise. The code is for MINGW; Cygwin does not set > that that > var and is likely to use return values closer to POSIX. I don't use Windows, but this LGTM. > OK for mainline? Yes, and thanks for the patch! Harald > > Tobias > ----------------- > Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe = 201, > 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: > Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaft: M=C3=BCnchen; > Registergericht M=C3=BCnchen, HRB 106955