From: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: Jason Gunthorpe <jgg-uk2M96/98Pc@public.gmane.org>
Cc: sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH rdma-core] librdmacm: Store error code from getaddrinfo in errno
Date: Thu, 9 Nov 2017 09:57:10 +0200 [thread overview]
Message-ID: <20171109075709.GA3260@yuvallap> (raw)
In-Reply-To: <20171107155602.GD21466-uk2M96/98Pc@public.gmane.org>
On Tue, Nov 07, 2017 at 08:56:02AM -0700, Jason Gunthorpe wrote:
> On Tue, Nov 07, 2017 at 11:50:38AM +0200, Yuval Shaia wrote:
> > +++ b/librdmacm/addrinfo.c
> > @@ -227,7 +227,7 @@ static int ucma_getaddrinfo(const char *node, const char *service,
> > ret = getaddrinfo(node, service, NULL, &ai);
> > }
> > if (ret)
> > - return ret;
> > + return ERR(ret);
Fine, dropping this, will fix only the printouts then.
>
> No, you cannot assign the return value from getaddrinfo directly errno, they
> are not the same number space.
>
> > diff --git a/librdmacm/examples/cmatose.c b/librdmacm/examples/cmatose.c
> > index b1c9dd13..625849ce 100644
> > +++ b/librdmacm/examples/cmatose.c
> > @@ -507,7 +507,7 @@ static int run_server(void)
> >
> > ret = get_rdma_addr(src_addr, dst_addr, port, &hints, &test.rai);
> > if (ret) {
> > - printf("cmatose: getrdmaaddr error: %s\n", gai_strerror(ret));
> > + printf("cmatose: getrdmaaddr error: %s\n", gai_strerror(errno));
>
> Also nope, gai_strerror does not process errnos.
>
> Jason
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2017-11-09 7:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-07 9:50 [PATCH rdma-core] librdmacm: Store error code from getaddrinfo in errno Yuval Shaia
[not found] ` <20171107095038.7348-1-yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2017-11-07 15:56 ` Jason Gunthorpe
[not found] ` <20171107155602.GD21466-uk2M96/98Pc@public.gmane.org>
2017-11-09 7:57 ` Yuval Shaia [this message]
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=20171109075709.GA3260@yuvallap \
--to=yuval.shaia-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
--cc=hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
--cc=jgg-uk2M96/98Pc@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox