X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fgetvserverctx.c;h=42b940cccd53d1d9f492a281f39630eddce2f49f;hb=HEAD;hp=fda8d733964a81dbdeee1ca3e6b65b878c982b45;hpb=3564d8678a2134185e5e6e83083de027b359ca28;p=util-vserver.git diff --git a/lib/getvserverctx.c b/lib/getvserverctx.c index fda8d73..42b940c 100644 --- a/lib/getvserverctx.c +++ b/lib/getvserverctx.c @@ -175,12 +175,15 @@ vc_getVserverCtx(char const *id, vcCfgStyle style, bool honor_static, bool *is_r : 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 @@ -194,6 +197,10 @@ vc_getVserverCtx(char const *id, vcCfgStyle style, bool honor_static, bool *is_r } res = getCtxFromFile(buf); + if (res==VC_NOCTX && type!=vcCTX_XID) { + type = vcCTX_XID; + goto check_static; + } } return res;