Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh behavior when fork() failed
- X-seq: zsh-workers 30268
- From: Dipak Gaigole <dipakgaigole@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: zsh behavior when fork() failed
- Date: Sat, 25 Feb 2012 22:03:33 +0530
- Authentication-results: mr.google.com; spf=pass (google.com: domain of dipakgaigole@xxxxxxxxx designates 10.152.128.38 as permitted sender) smtp.mail=dipakgaigole@xxxxxxxxx; dkim=pass header.i=dipakgaigole@xxxxxxxxx
- Cc: zsh-workers@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=MCapxxKsSemx8OLX1Cuu455HL0Z1vrEWsptOn2oKK58=; b=fjoraNg7MFehD36Ea0fxuSWkX/7GwZjFFnHgzct3pBxB+GhLnFPRNOhmVyFNCJDtYa dQjO173WiQD4TZOI7y9ibXlVlCLVi+kV2lEXPnWHrQMWnM+iPLPXifU4ikY3RCd/WOLw pCElEq+eGtB8XLYMffg+HKToOMQKJ0g+tHyZU=
- In-reply-to: <120224100518.ZM13322@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CADs2-=SFXA0rt1tKvBTnJC=UGdeaQk_GhSp_xM9EGFi_RW_YxA@mail.gmail.com> <120223081441.ZM2715@torch.brasslantern.com> <CADs2-=Qz7RaX_ntVupWo=rk+-cKj45-i1K=rhm9p6Apw-xa5sQ@mail.gmail.com> <120224100518.ZM13322@torch.brasslantern.com>
On Fri, Feb 24, 2012 at 11:35 PM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Feb 24, 4:38pm, Dipak Gaigole wrote:
> }
> } As we can see that zsh continues even if it knows that it has failed
> } in fork and finally the script return status is 0.
>
> The script return status is zero because the last command it executed
> was successful. That has nothing to do with the rest of the question.
>
Yes, I understand.
> } Also checking for $? after each command is not feasible. So doesn't
> } this zsh behavior looks misleading?
>
> Depends on whether fork failure is supposed to be fatal to the shell.
> I looked at:
> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html
>
> Section 2.8.1 lists command execution failures where a non-interactive
> shell "shall exit", but fork failure is not among them.
Got it. But I don't want to add a check of $? after each command in
the scripts specially in cases where scripts are 1000+ lines.
Is there any zsh option to make sure script exit when fork fails? Else
can I patch the zsh code to make script exit on fork failure?
Thanks,
Dipak
Messages sorted by:
Reverse Date,
Date,
Thread,
Author