From: Andreas Schwab via Libc-alpha <libc-alpha@sourceware.org>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: libc-alpha@sourceware.org, arnaud.lb@gmail.com
Subject: Re: [PATCH] stdio: Do not ignore posix_spawn error on popen (BZ #29016)
Date: Tue, 06 Dec 2022 17:53:52 +0100 [thread overview]
Message-ID: <mvmfsdswk0v.fsf@suse.de> (raw)
In-Reply-To: <20221206164503.2534492-1-adhemerval.zanella@linaro.org> (Adhemerval Zanella's message of "Tue, 6 Dec 2022 13:45:03 -0300")
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."
prev parent reply other threads:[~2022-12-06 16:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-06 16:45 [PATCH] stdio: Do not ignore posix_spawn error on popen (BZ #29016) Adhemerval Zanella via Libc-alpha
2022-12-06 16:53 ` Andreas Schwab via Libc-alpha [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/libc/involved.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=mvmfsdswk0v.fsf@suse.de \
--to=libc-alpha@sourceware.org \
--cc=adhemerval.zanella@linaro.org \
--cc=arnaud.lb@gmail.com \
--cc=schwab@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).