[CRIU] [PATCH 2/5] unix: Use once helper for post-prep

Pavel Emelyanov xemul at virtuozzo.com
Fri May 26 05:44:55 PDT 2017


Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
---
 criu/sk-unix.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/criu/sk-unix.c b/criu/sk-unix.c
index 866e3c0..bf19024 100644
--- a/criu/sk-unix.c
+++ b/criu/sk-unix.c
@@ -1383,17 +1383,14 @@ static struct pprep_head resolve_unix_peers = {
 static int collect_one_unixsk(void *o, ProtobufCMessage *base, struct cr_img *i)
 {
 	struct unix_sk_info *ui = o;
-	static bool post_queued = false;
 	char *uname, *prefix = "";
 	int ulen;
 
 	ui->ue = pb_msg(base, UnixSkEntry);
 	ui->name_dir = (void *)ui->ue->name_dir;
 
-	if (ui->ue->peer && !post_queued) {
-		post_queued = true;
-		add_post_prepare_cb(&resolve_unix_peers);
-	}
+	if (ui->ue->peer)
+		add_post_prepare_cb_once(&resolve_unix_peers);
 
 	if (ui->ue->name.len) {
 		if (ui->ue->name.len > UNIX_PATH_MAX) {
-- 
2.1.4



More information about the CRIU mailing list