Re: [PATCH] multipath -u: test socket connection in non-blocking mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2019-04-24 at 07:48 +0200, Hannes Reinecke wrote:
> On 4/23/19 9:32 PM, Martin Wilck wrote:
> >   
> > +/*
> > + * connect to a unix domain socket
> > + */
> > +int mpath_connect(void)
> > +{
> > +	int fd = __mpath_connect(0);
> > +
> > +	if (fd >= 0)
> > +		return fd;
> > +	errno = -fd;
> > +	return -1;
> > +}
> > +
> >   int mpath_disconnect(int fd)
> >   {
> >   	return close(fd);
> Please do away with the wrapper.
> No point in having it; rather use a consistent return value
> (ie either -1 and setting errno, or returning -errno directly).

I can't easily do away with the wrapper, as it's part of the public
libmpathcmd API, external commands may rely on its behavior. I'll
repost with -1 / errno semantics.

Martin

-- 
Dr. Martin Wilck <mwilck@xxxxxxxx>, Tel. +49 (0)911 74053 2107
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)


--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux