X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Frpm-fake.c;h=e19fe889cb51954c38c22c34c5cd1d830e56a5f5;hb=d7b84da7bc10825f00c80b055f8f7f32afced5cc;hp=380bf0722283ee5716445b03c68b34dbf43c0bc3;hpb=eea3d83e4d401f0a214721bf0438a484cbe5dd68;p=util-vserver.git diff --git a/src/rpm-fake.c b/src/rpm-fake.c index 380bf07..e19fe88 100644 --- a/src/rpm-fake.c +++ b/src/rpm-fake.c @@ -245,9 +245,9 @@ setupContext(xid_t xid, char const **xid_str) xid_t rc=VC_NOCTX; if ((xid==VC_DYNAMIC_XID || !vc_is_dynamic_xid(xid)) && - (rc=vc_ctx_create(xid))==VC_NOCTX && + (rc=vc_ctx_create(xid, NULL))==VC_NOCTX && errno!=EEXIST) { - perror(ENSC_WRAPPERS_PREFIX "vc_create_context()"); + perror(ENSC_WRAPPERS_PREFIX "vc_ctx_create()"); exit(255); } @@ -510,6 +510,13 @@ exitRPMFake() uint8_t c; if (read(sync_sock, &c, 1)!=1) { /*...*/ } if (write(pw_sock, "Q", 1)!=1) { /*...*/ } + if (vc_isSupported(vcFEATURE_VWAIT)) { + if (vc_wait_exit(ctx)==-1) { /*...*/ } + } + else { + /* this can race */ + if (read(sync_sock, &c, 1)!=0) { /*...*/} + } } } @@ -595,7 +602,7 @@ execvWorker(char const *path, char * const argv[], char * const envp[]) int res = -1; if (vc_isSupported(vcFEATURE_MIGRATE)) - res = vc_ctx_migrate(ctx); + res = vc_ctx_migrate(ctx, 0); else { #ifdef VC_ENABLE_API_COMPAT res = vc_new_s_context(ctx,caps,flags);