Commit a9001753 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by Andrei Vagin

unix: Use once helper for post-prep

Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 0a820d8d
...@@ -1367,17 +1367,14 @@ static struct pprep_head resolve_unix_peers = { ...@@ -1367,17 +1367,14 @@ static struct pprep_head resolve_unix_peers = {
static int collect_one_unixsk(void *o, ProtobufCMessage *base, struct cr_img *i) static int collect_one_unixsk(void *o, ProtobufCMessage *base, struct cr_img *i)
{ {
struct unix_sk_info *ui = o; struct unix_sk_info *ui = o;
static bool post_queued = false;
char *uname, *prefix = ""; char *uname, *prefix = "";
int ulen; int ulen;
ui->ue = pb_msg(base, UnixSkEntry); ui->ue = pb_msg(base, UnixSkEntry);
ui->name_dir = (void *)ui->ue->name_dir; ui->name_dir = (void *)ui->ue->name_dir;
if (ui->ue->peer && !post_queued) { if (ui->ue->peer)
post_queued = true; add_post_prepare_cb_once(&resolve_unix_peers);
add_post_prepare_cb(&resolve_unix_peers);
}
if (ui->ue->name.len) { if (ui->ue->name.len) {
if (ui->ue->name.len > UNIX_PATH_MAX) { if (ui->ue->name.len > UNIX_PATH_MAX) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment