2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 13:58:34 +00:00

files: generate unique transport socket names

Transport socket names have to be unique for each criu run.

Fixes #1735 #1720

Signed-off-by: Andrei Vagin <avagin@gmail.com>
This commit is contained in:
Andrei Vagin
2022-02-12 17:24:07 -08:00
parent 408a7d82d6
commit e8087fcff6

View File

@@ -957,7 +957,7 @@ static int receive_fd(struct fdinfo_list_entry *fle);
static void transport_name_gen(struct sockaddr_un *addr, int *len, int pid)
{
addr->sun_family = AF_UNIX;
snprintf(addr->sun_path, UNIX_PATH_MAX, "x/crtools-fd-%d", pid);
snprintf(addr->sun_path, UNIX_PATH_MAX, "x/crtools-fd-%d-%" PRIx64, pid, criu_run_id);
*len = SUN_LEN(addr);
*addr->sun_path = '\0';
}