From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.3 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id CB6611F601 for ; Tue, 6 Dec 2022 16:54:14 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="ZOkNaGuO"; dkim-atps=neutral Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id ADF5F384C92C for ; Tue, 6 Dec 2022 16:54:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ADF5F384C92C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1670345653; bh=avd/7nU8hMfk7C43JwoYFrgq5PtSdFxS/CoIw5k2Y2o=; h=To:Cc:Subject:References:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=ZOkNaGuOD0enSaqlzpXTyOdcpLCcg8F1Rbd3Oa5LpCmfWzhQRGqFIrGxMBVmFWO4/ +qJ3svg6CE0P3fgSfJzScM1q9xSJpeU2u8aJsnAiu5orGJYlSH3bgbI6Cv0wYvPRlS a2SUR+aq95KBrLospZNDTbeE80Ef9X/mBuFJw0iU= Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id BD04438493F1 for ; Tue, 6 Dec 2022 16:53:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BD04438493F1 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 06BFF21C35; Tue, 6 Dec 2022 16:53:53 +0000 (UTC) Received: from hawking.suse.de (unknown [10.168.4.11]) by relay2.suse.de (Postfix) with ESMTP id F21D72C141; Tue, 6 Dec 2022 16:53:52 +0000 (UTC) Received: by hawking.suse.de (Postfix, from userid 17005) id ABB5F44012D; Tue, 6 Dec 2022 17:53:52 +0100 (CET) To: Adhemerval Zanella Cc: libc-alpha@sourceware.org, arnaud.lb@gmail.com Subject: Re: [PATCH] stdio: Do not ignore posix_spawn error on popen (BZ #29016) References: <20221206164503.2534492-1-adhemerval.zanella@linaro.org> X-Yow: Now I need a suntan, a tennis lesson, Annette Funicello and two dozen Day-Glo orange paper jumpsuits!! Date: Tue, 06 Dec 2022 17:53:52 +0100 In-Reply-To: <20221206164503.2534492-1-adhemerval.zanella@linaro.org> (Adhemerval Zanella's message of "Tue, 6 Dec 2022 13:45:03 -0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Andreas Schwab via Libc-alpha Reply-To: Andreas Schwab Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On Dez 06 2022, Adhemerval Zanella wrote: > To correctly return error in case of default shell is not present. Ok. > diff --git a/libio/iopopen.c b/libio/iopopen.c > index 06778cf110..e4be6c9779 100644 > --- a/libio/iopopen.c > +++ b/libio/iopopen.c > @@ -66,11 +66,12 @@ unlock (void *not_used) > be close (by transversing the proc_file_chain list) and the insertion of a > new one after a successful posix_spawn this function should be called > with proc_file_chain_lock acquired. */ > -static bool > +static int > spawn_process (posix_spawn_file_actions_t *fa, FILE *fp, const char *command, > int do_cloexec, int pipe_fds[2], int parent_end, int child_end, > int child_pipe_fd) > { > + int err = 0; I don't think this needs to be initialized here. > diff --git a/stdio-common/tst-popen3.c b/stdio-common/tst-popen3.c > new file mode 100644 > index 0000000000..add5e97c09 > --- /dev/null > +++ b/stdio-common/tst-popen3.c > @@ -0,0 +1,38 @@ > +/* Check if popen return a correct error code if the default shell does not s/return/returns/ > + exists (BZ#29016). s/exists/exist/ -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."