zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: <zsh-workers@zsh.org>
Subject: Re: missing braces or wrong indent?
Date: Mon, 13 May 2019 09:47:06 +0100	[thread overview]
Message-ID: <1557737226.5779.5.camel@samsung.com> (raw)
In-Reply-To: <CAHYJk3S1BTGRZTmeQha71mXu4k1+yqxtmMwWOTWJB4RAHa+AcA@mail.gmail.com>

On Sat, 2019-05-11 at 20:04 +0200, Mikael Magnusson wrote:
> Just submitted a new coverity build and looked at some stuff it was
> unhappy about; this isn't one of them but what is going on here?
> 
> clone.c::bin_clone
> 55
>     if (!pid) {
> 	clearjobtab(0);
> 	ppid = getppid();
> 	mypid = getpid();
> #ifdef HAVE_SETSID
> 	if (setsid() != mypid)
> 	    zwarnnam(nam, "failed to create new session: %e", errno);
> #elif defined(TIOCNOTTY)
> 	    if (ioctl(SHTTY, TIOCNOTTY, 0))
> 	    zwarnnam(*args, "%e", errno);
> 	    setpgrp(0L, mypid);
> #endif
> 	dup2(ttyfd,0);
>
> This/these if statements look completely bogusly indented, but maybe
> it's also missing braces? I can't tell because I have no idea what it
> wants to accomplish.

I'd guess just the indentation; I can't see why the setpgrp() would be
particularly useful on failure.  Alternatively, possibly there could
even be an "else" before the setpgrp()?  Presumably this is rarely
compiled and even then the ioctl() doesn't usually fail so very hard to
see the effect of.

pws




      reply	other threads:[~2019-05-13  8:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20190511180553epcas2p2115461224eb064782dcff498f1b57b74@epcas2p2.samsung.com>
2019-05-11 18:04 ` Mikael Magnusson
2019-05-13  8:47   ` Peter Stephenson [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

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

  git send-email \
    --in-reply-to=1557737226.5779.5.camel@samsung.com \
    --to=p.stephenson@samsung.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).