On 10/18/2013 03:21 PM, Kim De Mey wrote:



2013/10/18 Philippe Gerum <r...@xenomai.org <mailto:r...@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.de...@gmail.com
            <mailto:kim.de...@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.

_______________________________________________
Xenomai mailing list
Xenomai@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai

Reply via email to