mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
libxc: Fix Segmentation fault of xend
If /proc/xen/privcmd cannot be opened, start xend occurs Segmentation fault. Add check to fix it. Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
This commit is contained in:
1 parent
636fed5063
commit
ff4cc39490
1 file changed
+4
-2
@@ -82,8 +82,10 @@ const xc_error *xc_get_last_error(xc_interface *xch)
|
||||
|
||||
void xc_clear_last_error(xc_interface *xch)
|
||||
{
|
||||
xch->last_error.code = XC_ERROR_NONE;
|
||||
xch->last_error.message[0] = '\0';
|
||||
if (xch) {
|
||||
xch->last_error.code = XC_ERROR_NONE;
|
||||
xch->last_error.message[0] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
const char *xc_error_code_to_desc(int code)
|
||||
|
||||