mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: [PATCH v3] Implement fmtmsg
Date: Sat, 21 Jun 2014 19:32:11 -0400	[thread overview]
Message-ID: <20140621233211.GI179@brightrain.aerifal.cx> (raw)
In-Reply-To: <20140621171311.GA17812@newbook>

On Sat, Jun 21, 2014 at 05:13:12PM +0000, Isaac Dunham wrote:
> On Sat, Jun 21, 2014 at 12:18:14PM -0400, Rich Felker wrote:
> > On Sat, Jun 21, 2014 at 03:56:38PM +0000, Isaac Dunham wrote:
> > > > This is the wrong check for consoldfd being valid; 0 is a valid fd,
> > > > whereas consolefd==-1 passes the test.
> > > > 
> > > > So I think consolefd should be initialized to -1 not 0 and the check
> > > > here should be >=0. Or we could just reorder the severity lines above
> > > > the opening of the console so that the opening and use of consolefd
> > > > aren't separated like this.
> > > 
> > > As far as I can tell:
> > > -severity really should go above this (grouping related subjects)
> > 
> > OK we agree on this.
> > 
> > > -initializing to -1 will expose a bit of brokenness in here:
> > > 	RET=MM_NOCON;
> > > would be executed whenever we did not successfully open the console,
> > > whether or not we tried to open it.
> > > It would be better to
> > >  * leave the initialization alone, or move the error block into the same
> > > if() {} block as the call to open().
> > 
> > The latter is better. Using 0 to mean "none" for a file descriptor
> > variable is bad practice in general.
> > 
> > BTW while making these changes I noticed that you never close
> > consolefd. I added that in the same place. Also made a few other
> > improvements. See if the attached file looks better.
> 
> It looks much better.
> At this point, consolefd need not be initialized, and I think that will be
> the last change.

Committed. If you see anything else that looks like it needs changing,
just let me know.

Rich


      reply	other threads:[~2014-06-21 23:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-25  5:06 [PATCH] " Isaac Dunham
2014-04-25 14:49 ` Rich Felker
2014-04-25 16:10   ` [PATCH v2] " Isaac Dunham
2014-04-25 16:12     ` Isaac Dunham
2014-06-20  3:23       ` Rich Felker
2014-06-20  4:46         ` Isaac Dunham
2014-06-20 14:32         ` [PATCH v3] " Isaac Dunham
2014-06-21  4:46           ` Rich Felker
2014-06-21 13:41             ` Isaac Dunham
2014-06-21 14:39               ` Rich Felker
2014-06-21 15:56                 ` Isaac Dunham
2014-06-21 16:18                   ` Rich Felker
2014-06-21 17:13                     ` Isaac Dunham
2014-06-21 23:32                       ` Rich Felker [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=20140621233211.GI179@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /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/musl/

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).