From: Roger Pau Monne Date: Thu, 19 Jan 2012 10:21:10 +0000 (+0100) Subject: libxc: add comment to why NetBSD return hypercall->retval X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~8918 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b21046d2eaad49c6e943c1618ba07a9b7da9cd0d;p=xen.git libxc: add comment to why NetBSD return hypercall->retval Added a comment that explains why NetBSD return hypercall->retval on success. Signed-off-by: Roger Pau Monne Acked-by: Ian Campbell Committed-by: Ian Jackson Reported-by: Olaf Hering --- diff --git a/tools/libxc/xc_netbsd.c b/tools/libxc/xc_netbsd.c index 9782a3423a..b6d67bbb8c 100644 --- a/tools/libxc/xc_netbsd.c +++ b/tools/libxc/xc_netbsd.c @@ -96,6 +96,12 @@ static int netbsd_privcmd_hypercall(xc_interface *xch, xc_osdep_handle h, privcm int fd = (int)h; int error = ioctl(fd, IOCTL_PRIVCMD_HYPERCALL, hypercall); + /* + * Since NetBSD ioctl can only return 0 on success or < 0 on + * error, if we want to return a value from ioctl we should + * do so by setting hypercall->retval, to mimic Linux ioctl + * implementation. + */ if (error < 0) return -errno; else