ia64/xen-unstable

changeset 12840:5aea6a32fc8b

[LIBXC] Python error extraction tweak.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Thu Dec 07 11:46:07 2006 +0000 (2006-12-07)
parents 8e035701b9ff
children 5a21379d0879
files tools/python/xen/lowlevel/xc/xc.c
line diff
     1.1 --- a/tools/python/xen/lowlevel/xc/xc.c	Thu Dec 07 11:45:00 2006 +0000
     1.2 +++ b/tools/python/xen/lowlevel/xc/xc.c	Thu Dec 07 11:46:07 2006 +0000
     1.3 @@ -46,7 +46,10 @@ static PyObject *pyxc_error_to_exception
     1.4      const xc_error const *err = xc_get_last_error();
     1.5      const char *desc = xc_error_code_to_desc(err->code);
     1.6  
     1.7 -    if (err->message[1])
     1.8 +    if (err->code == XC_ERROR_NONE)
     1.9 +        return PyErr_SetFromErrno(xc_error_obj);
    1.10 +
    1.11 +    if (err->message[0] != '\0')
    1.12  	pyerr = Py_BuildValue("(iss)", err->code, desc, err->message);
    1.13      else
    1.14  	pyerr = Py_BuildValue("(is)", err->code, desc);