|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 1/2] xenstored: Use xenbus_backend device on Linux
On Thu, Dec 15, 2011 at 05:07:34PM +0000, Ian Campbell wrote:
> +static int linux_xenbus_backend_interface(xc_interface *xch, xc_osdep_handle
> h, void **map, evtchn_port_t *port)
> +{
> + int ret, fd;
> + void *addr;
> +
> + fd = open(XENSTORED_DEV, O_RDWR);
> + if (fd == -1)
> + {
> + if ( errno != ENOENT )
> + return -1;
This makes the code hard to read. You should first do the stuff on
success and then the error handling.
> +int xc_xenbus_backend_interface(xc_interface *xch, void **map, evtchn_port_t
> *port)
I prefer returning structs over such pointer stunts, but okay.
Bastian
--
There are always alternatives.
-- Spock, "The Galileo Seven", stardate 2822.3
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |