ia64/xen-unstable

changeset 7977:f546d8697b0e

Misc fixes for breakage when moving to new Python/C interface style.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@leeni.uk.xensource.com
date Mon Nov 21 19:08:27 2005 +0100 (2005-11-21)
parents 11a06dd44a8d
children c1c8da6f2afe
files tools/python/xen/lowlevel/xc/xc.c
line diff
     1.1 --- a/tools/python/xen/lowlevel/xc/xc.c	Mon Nov 21 18:47:31 2005 +0100
     1.2 +++ b/tools/python/xen/lowlevel/xc/xc.c	Mon Nov 21 19:08:27 2005 +0100
     1.3 @@ -1061,14 +1061,14 @@ static PyObject *PyXc_getattr(PyObject *
     1.4      return Py_FindMethod(pyxc_methods, obj, name);
     1.5  }
     1.6  
     1.7 -static PyObject *PyXc_new(PyTypeObject *type, PyObject *args)
     1.8 +static PyObject *PyXc_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
     1.9  {
    1.10      XcObject *self = (XcObject *)type->tp_alloc(type, 0);
    1.11  
    1.12      if (self == NULL)
    1.13          return NULL;
    1.14  
    1.15 -    self->xc_handle = NULL;
    1.16 +    self->xc_handle = -1;
    1.17  
    1.18      return (PyObject *)self;
    1.19  }
    1.20 @@ -1086,9 +1086,9 @@ PyXc_init(XcObject *self, PyObject *args
    1.21  
    1.22  static void PyXc_dealloc(XcObject *self)
    1.23  {
    1.24 -    if (self->xc_handle) {
    1.25 +    if (self->xc_handle != -1) {
    1.26          xc_interface_close(self->xc_handle);
    1.27 -        self->xc_handle = NULL;
    1.28 +        self->xc_handle = -1;
    1.29      }
    1.30  
    1.31      self->ob_type->tp_free((PyObject *)self);
    1.32 @@ -1145,7 +1145,7 @@ PyMODINIT_FUNC initxc(void)
    1.33      if (PyType_Ready(&PyXcType) < 0)
    1.34          return;
    1.35  
    1.36 -    m = Py_InitModule(PKG, PyXc_methods);
    1.37 +    m = Py_InitModule(PKG, xc_methods);
    1.38  
    1.39      if (m == NULL)
    1.40        return;