]> xenbits.xensource.com Git - people/vhanquez/xen.git/commitdiff
libxc: add comment to why NetBSD return hypercall->retval
authorRoger Pau Monne <roger.pau@entel.upc.edu>
Thu, 19 Jan 2012 10:21:10 +0000 (11:21 +0100)
committerRoger Pau Monne <roger.pau@entel.upc.edu>
Thu, 19 Jan 2012 10:21:10 +0000 (11:21 +0100)
Added a comment that explains why NetBSD return hypercall->retval on
success.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Campbell <ian.campbell.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Reported-by: Olaf Hering <olaf@aepfle.de>
tools/libxc/xc_netbsd.c

index 9782a3423aea7abd80ed3ae8dde767dbce7752ad..b6d67bbb8c69766f3b88fd47b9edb074cc78ca52 100644 (file)
@@ -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