Fix remanining vc_getVserverCtx caller.
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2596
94cd875c-1c1d-0410-91d2-
eb244daf1a30
if (l<=4 || strcmp(name+l-4, ".ctx")!=0) continue;
name[l-4] = '\0';
- cur_xid = vc_getVserverCtx(name, vcCFG_LEGACY, false, 0);
+ cur_xid = vc_getVserverCtx(name, vcCFG_LEGACY, false, 0, vcCTX_XID);
if (cur_xid!=xid) continue;
result = strdup(name);
: VC_NOCTX); // correct the value of 'res'
free(cur_name);
+
+ if (is_running) // fill 'is_running' information...
+ *is_running = res!=VC_NOCTX;
}
-
- if (is_running) // fill 'is_running' information...
- *is_running = res!=VC_NOCTX;
-
+ else if (is_running)
+ *is_running = false;
+
if (res==VC_NOCTX && honor_static) {
+check_static:
switch (type) {
case vcCTX_XID:
memcpy(buf+idx, "/context", 9); // appends '\0' too
}
res = getCtxFromFile(buf);
+ if (res==VC_NOCTX && type!=vcCTX_XID) {
+ type = vcCTX_XID;
+ goto check_static;
+ }
}
return res;