From: Pavel Roskin <proski@gnu.org>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: /kern/file.c BUG
Date: Thu, 24 Jan 2008 22:22:17 -0500 [thread overview]
Message-ID: <1201231337.2811.7.camel@dv> (raw)
In-Reply-To: <94a0ccbc0801241343p75ec7033h1ddb9d819163f846@mail.gmail.com>
On Thu, 2008-01-24 at 21:43 +0000, Oleg Strikov wrote:
> But is it correct to check and handle errno in some `library`
> function (now we do) ? I CAN, but i do not have to examine
> errno after each non-error-free call; is it right?
I don't know how grub_errno is supposed to work, so I cannot comment on
that.
But normally it's OK to read errno if it's known that some error has
happened. It makes it possible to have one error handler that would not
specify which exactly call has failed. For instance, it's not important
if an I/O error happened when opening the file or when reading from it,
or when closing it.
It should be OK to set errno to 0 only if it's definitely known that the
callers (not necessarily the immediate caller) don't expect errno to be
preserved. Therefore, setting errno to 0 in a library would be wrong.
--
Regards,
Pavel Roskin
next prev parent reply other threads:[~2008-01-25 3:22 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-24 21:43 /kern/file.c BUG Oleg Strikov
2008-01-25 3:22 ` Pavel Roskin [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-01-23 23:00 Oleg Strikov
2008-01-24 0:05 ` Robert Millan
2008-01-24 18:08 ` Vesa Jääskeläinen
2008-01-24 18:34 ` Pavel Roskin
2008-01-24 21:19 ` Yoshinori K. Okuji
2008-01-24 22:09 ` Marco Gerards
2008-01-24 23:00 ` Robert Millan
2008-01-24 23:27 ` Robert Millan
2008-01-25 8:47 ` Marco Gerards
2008-01-25 8:45 ` Marco Gerards
2008-01-25 8:50 ` Marco Gerards
2008-01-25 23:57 ` Robert Millan
2008-01-26 12:04 ` Marco Gerards
2008-01-26 17:05 ` Robert Millan
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=1201231337.2811.7.camel@dv \
--to=proski@gnu.org \
--cc=grub-devel@gnu.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.