[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH] Propagate kernel errors in libxc
diff -r fcd625c4f896 tools/libxc/xc_linux.c --- a/tools/libxc/xc_linux.c Mon Nov 05 10:39:07 2007 -0500 +++ b/tools/libxc/xc_linux.c Mon Nov 05 10:39:07 2007 -0500 @@ -153,7 +153,12 @@ int xc_map_foreign_ranges(int xc_handle, static int do_privcmd(int xc_handle, unsigned int cmd, unsigned long data) { - return ioctl(xc_handle, cmd, data); + int ret = ioctl(xc_handle, cmd, data); + if (ret >= 0) + return ret; + if (errno) // kernel errors are passed through errno with ioctl() ret == -1 + return (errno > 0) ? -errno : errno; + return ret; } int do_xen_hypercall(int xc_handle, privcmd_hypercall_t *hypercall) _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |