From 497c1688595953b76fcc0e79226e4038753c423f Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Sun, 20 Jan 2008 08:01:17 +0000 Subject: [PATCH] Hopefully this will make it bullet-proof. git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2665 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- src/rpm-fake.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/rpm-fake.c b/src/rpm-fake.c index b0ce156..e19fe88 100644 --- a/src/rpm-fake.c +++ b/src/rpm-fake.c @@ -510,8 +510,13 @@ 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) { /*...*/ } + if (vc_isSupported(vcFEATURE_VWAIT)) { + if (vc_wait_exit(ctx)==-1) { /*...*/ } + } + else { + /* this can race */ + if (read(sync_sock, &c, 1)!=0) { /*...*/} + } } } -- 1.8.1.5