From: Philippe Gerum <rpm@xenomai.org>
To: Kim De Mey <kim.demey@gmail.com>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai] [PATCH 2 of 2] Xenomai-forge notifier_init: panic on failed pipe
Date: Fri, 18 Oct 2013 15:40:06 +0200 [thread overview]
Message-ID: <52613A36.1060609@xenomai.org> (raw)
In-Reply-To: <CAKc2HpZubV6rLEO1d2D9UHPuN=DJDbxn=0x6tJhDctbG7KqYcQ@mail.gmail.com>
On 10/18/2013 03:21 PM, Kim De Mey wrote:
>
>
>
> 2013/10/18 Philippe Gerum <rpm@xenomai.org <mailto:rpm@xenomai.org>>
>
> On 10/18/2013 02:54 PM, Philippe Gerum wrote:
>
> On 10/18/2013 02:50 PM, Kim De Mey wrote:
>
> Panic if one of the pipe() system calls fails. To indicate
> that there
> is an underlying problem.
>
> Signed-off-by: Kim De Mey <kim.demey@gmail.com
> <mailto:kim.demey@gmail.com>>
>
> ---
>
> lib/copperplate/notifier.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/copperplate/notifier.c
> b/lib/copperplate/notifier.c
> --- a/lib/copperplate/notifier.c
> +++ b/lib/copperplate/notifier.c
> @@ -144,12 +144,12 @@ int notifier_init(struct notifier *nf,
> int fd;
>
> if (pipe(nf->psfd) < 0)
> - return __bt(-errno);
> + panic("failed to create file descriptors");
>
> if (pipe(nf->pwfd) < 0) {
> __STD(close(nf->psfd[0]));
> __STD(close(nf->psfd[1]));
> - return __bt(-errno);
> + panic("failed to create file descriptors");
> }
>
> nf->callback = callback;
>
>
> Nack. This routine returns a status code, the caller should
> check it.
>
>
> warning() would be acceptable though, for the same purpose, while
> still propagating the error code instead of pulling the break
> arbitrarily.
>
>
> Agreed it would be much better if the caller checked it. But it is
> currently not checked in threadobj_setup_corespec(). And as I am unsure
> of what to do with it in that function I did this patch.
>
> Although a warning is probably enough indeed in case nothing is done
> with the error in threadobj_setup_corespec().
>
We can't rely on this assumption, since this may evolve, including for
Mercury. This said, assert() on the status code of notifier_init()
within that routine would make sense, so that it triggers in debug mode
when the app starts.
--
Philippe.
next prev parent reply other threads:[~2013-10-18 13:40 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-18 12:50 [Xenomai] [PATCH 0 of 2] Xenomai-forge thread_obj: unset __THREAD_S_SAFE when not needed Kim De Mey
2013-10-18 12:50 ` [Xenomai] [PATCH 1 " Kim De Mey
2013-10-18 12:50 ` [Xenomai] [PATCH 2 of 2] Xenomai-forge notifier_init: panic on failed pipe Kim De Mey
2013-10-18 12:54 ` Philippe Gerum
2013-10-18 12:57 ` Philippe Gerum
2013-10-18 13:21 ` Kim De Mey
2013-10-18 13:40 ` Philippe Gerum [this message]
2013-10-18 15:12 ` Kim De Mey
2013-10-18 13:06 ` [Xenomai] [PATCH 0 of 2] Xenomai-forge thread_obj: unset __THREAD_S_SAFE when not needed Philippe Gerum
2013-10-18 15:55 ` Kim De Mey
2013-10-19 18:42 ` Ronny Meeus
2013-10-20 7:04 ` Philippe Gerum
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=52613A36.1060609@xenomai.org \
--to=rpm@xenomai.org \
--cc=kim.demey@gmail.com \
--cc=xenomai@xenomai.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.