[CRIU] [PATCH 11/18] sk-unix: Use add_post_prepare_cb_once helper

Cyrill Gorcunov gorcunov at openvz.org
Sun Apr 9 15:28:43 PDT 2017


And no need for ui->ue->peer peer, the resolve_unix_peers
will do it anyway.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 criu/sk-unix.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/criu/sk-unix.c b/criu/sk-unix.c
index d85356d890c1..8426e7ceafc7 100644
--- a/criu/sk-unix.c
+++ b/criu/sk-unix.c
@@ -1372,18 +1372,14 @@ static int resolve_unix_peers(void *unused);
 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;
-		if (add_post_prepare_cb(resolve_unix_peers, NULL))
-			return -1;
-	}
+	if (add_post_prepare_cb_once(resolve_unix_peers, NULL))
+		return -1;
 
 	if (ui->ue->name.len) {
 		if (ui->ue->name.len > UNIX_PATH_MAX) {
-- 
2.7.4



More information about the CRIU mailing list