X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Frpm-fake.c;h=b0ce156ebcd511526af5a1a8d16a66ec9f3b32f7;hb=90ceb7b399cf3c1eb8d0c7474bd2498fe62cd022;hp=2c1310639fca46623a44620571a6fc0a1646ed94;hpb=9c78378bebc1a9f3d400f422df8ede9efea57dea;p=util-vserver.git diff --git a/src/rpm-fake.c b/src/rpm-fake.c index 2c13106..b0ce156 100644 --- a/src/rpm-fake.c +++ b/src/rpm-fake.c @@ -66,10 +66,6 @@ int rpm_execcon(unsigned int verified, #undef _POSIX_SOURCE #include "capability-compat.h" -#ifndef CLONE_NEWNS -# define CLONE_NEWNS 0x00020000 -#endif - #define LIBNAME "rpm-fake.so" #define PLATFORM_FILE "/etc/rpm/platform" @@ -249,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); } @@ -514,6 +510,8 @@ exitRPMFake() uint8_t c; if (read(sync_sock, &c, 1)!=1) { /*...*/ } if (write(pw_sock, "Q", 1)!=1) { /*...*/ } + /* sync_sock should return EOF when the resolver exits... */ + if (read(sync_sock, &c, 1)!=0) { /*...*/ } } } @@ -599,7 +597,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);