zsh-workers
 help / color / mirror / code / Atom feed
From: Dipak Gaigole <dipakgaigole@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh-workers@zsh.org
Subject: Re: zsh behavior when fork() failed
Date: Sat, 25 Feb 2012 22:03:33 +0530	[thread overview]
Message-ID: <CADs2-=RNMAHz=fQOWjVm25XRL4xaGLzTtA7yL-FCQPrHdV5jpg@mail.gmail.com> (raw)
In-Reply-To: <120224100518.ZM13322@torch.brasslantern.com>

On Fri, Feb 24, 2012 at 11:35 PM, Bart Schaefer
<schaefer@brasslantern.com> 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


  reply	other threads:[~2012-02-25 16:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-23 10:40 Dipak Gaigole
2012-02-23 16:14 ` Bart Schaefer
2012-02-24 11:08   ` Dipak Gaigole
2012-02-24 18:05     ` Bart Schaefer
2012-02-25 16:33       ` Dipak Gaigole [this message]
2012-02-26 19:52         ` Bart Schaefer
2012-02-26 21:57           ` Bart Schaefer
2012-02-29 12:57           ` Dipak Gaigole
2012-02-29 19:06             ` Bart Schaefer
2012-03-06  9:01               ` Dipak Gaigole

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADs2-=RNMAHz=fQOWjVm25XRL4xaGLzTtA7yL-FCQPrHdV5jpg@mail.gmail.com' \
    --to=dipakgaigole@gmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).