mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: strftime sets errno to 22
Date: Sat, 23 Jul 2016 21:47:41 -0400	[thread overview]
Message-ID: <20160724014740.GM15995@brightrain.aerifal.cx> (raw)
In-Reply-To: <CAJDAfTDLRpGP1U38Kp89oziLzXjEscCCrNQrk8Q_FvNjZNxtXQ@mail.gmail.com>

On Sat, Jul 23, 2016 at 10:17:30PM -0300, Alba Pompeo wrote:
> Hello musl people.
> 
> I was reading some commits messages from a project and ended up seeing
> something that might be interesting to you.
> 
> https://github.com/izabera/inutility/commit/1db3ba948ad1d4cbfa8c0164fa475439c99c06bc
> 
> I don't think it's been reported yet.

Except for a few special functions with more restrictive
specification, you can only expect errno to contain something
meaningful immediately after a function returns with a return value
indicating an error. The code above was assuming that errno being set
indicated an error even when strftime succeeded.

With that said, at the time this was reported on IRC I looked for the
cause of errno being set to EINVAL and didn't see it. It might be nice
to know why it's happening, just in case some unintended code paths
with nontrivial cost are getting pulled in.

Rich


  reply	other threads:[~2016-07-24  1:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-24  1:17 Alba Pompeo
2016-07-24  1:47 ` Rich Felker [this message]
2016-07-24  6:59   ` Alexander Monakov
2016-07-24 15:34     ` Rich Felker

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=20160724014740.GM15995@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).