All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Kim De Mey <kim.demey@gmail.com>, xenomai@xenomai.org
Subject: Re: [Xenomai] [PATCH 2 of 2] Xenomai-forge notifier_init: panic on failed pipe
Date: Fri, 18 Oct 2013 14:57:16 +0200	[thread overview]
Message-ID: <5261302C.6010709@xenomai.org> (raw)
In-Reply-To: <52612F95.1080204@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>
>>
>> ---
>>
>>   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.

-- 
Philippe.


  reply	other threads:[~2013-10-18 12:57 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 [this message]
2013-10-18 13:21       ` Kim De Mey
2013-10-18 13:40         ` Philippe Gerum
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=5261302C.6010709@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.