fix for multiple entry
authorMarc Fiuczynski <mef@cs.princeton.edu>
Tue, 20 Sep 2005 21:19:57 +0000 (21:19 +0000)
committerMarc Fiuczynski <mef@cs.princeton.edu>
Tue, 20 Sep 2005 21:19:57 +0000 (21:19 +0000)
python/vserverimpl.c

index b2eab8e..09e3782 100644 (file)
@@ -60,7 +60,7 @@ vserver_chcontext(PyObject *self, PyObject *args)
 {
        struct vc_ctx_caps caps;
        struct vc_ctx_flags flags;
-       xid_t ctx;
+       xid_t ctx, xid;
 
        caps.ccaps = ~vc_get_insecureccaps();
        caps.cmask = ~0ull;
@@ -73,8 +73,8 @@ vserver_chcontext(PyObject *self, PyObject *args)
        if (!PyArg_ParseTuple(args, "I", &ctx))
                return NULL;
 
-       ctx = vc_ctx_create(ctx);
-       if (ctx == VC_NOCTX && errno != EEXIST) {
+       xid = vc_ctx_create(ctx);
+       if (xid == VC_NOCTX && errno != EEXIST) {
                return PyErr_SetFromErrno(PyExc_OSError);
        }
 
@@ -87,7 +87,7 @@ vserver_chcontext(PyObject *self, PyObject *args)
        }
 
        /* context already exists, migrate to it */
-       if (ctx == VC_NOCTX && vc_ctx_migrate(ctx) == -1) {
+       if (xid == VC_NOCTX && vc_ctx_migrate(ctx) == -1) {
                return PyErr_SetFromErrno(PyExc_OSError);
        }