+
+ // when context information could be read, we have to verify that
+ // it belongs to a running vserver and the both vservers are
+ // identically
+ if (res!=VC_NOCTX) {
+ char *cur_name;
+ struct vc_vx_info info;
+
+ // determine the vserver which is associated with the xid resp. skip
+ // this step when the context does not exist. When checking whether
+ // the context exists, do not rely on the success of
+ // vc_get_vx_info() alone but check 'errno' for ESRCH also. Else,
+ // wrong results will be caused e.g. for xid 1 which will fail with
+ // ENOSYS.
+ cur_name = (vc_get_vx_info(res, &info)!=-1 || errno!=ESRCH ?
+ vc_getVserverByCtx_Internal(res, &style, 0, false) :
+ 0);
+
+ buf[idx] = '\0'; // cut off the '/run' from the vserver name
+
+ res = ((cur_name!=0 &&
+ vc_compareVserverById(buf, vcCFG_RECENT_FULL,
+ cur_name, vcCFG_RECENT_FULL)==0)
+ ? res
+ : VC_NOCTX); // correct the value of 'res'
+
+ free(cur_name);
+ }
+
+ if (is_running) // fill 'is_running' information...
+ *is_running = res!=VC_NOCTX;