Commit 31a20bb7 authored by Pavel Emelyanov's avatar Pavel Emelyanov

unix: Fix external unix inode type

Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 26529414
...@@ -304,7 +304,7 @@ static int setup_opts_from_req(int sk, CriuOpts *req) ...@@ -304,7 +304,7 @@ static int setup_opts_from_req(int sk, CriuOpts *req)
if (req->has_ext_unix_sk) { if (req->has_ext_unix_sk) {
opts.ext_unix_sk = req->ext_unix_sk; opts.ext_unix_sk = req->ext_unix_sk;
for (i = 0; i < req->n_unix_sk_ino; i++) { for (i = 0; i < req->n_unix_sk_ino; i++) {
if (unix_sk_id_add(req->unix_sk_ino[i]->inode) < 0) if (unix_sk_id_add((unsigned int)req->unix_sk_ino[i]->inode) < 0)
goto err; goto err;
} }
} }
......
...@@ -51,7 +51,7 @@ extern int inet_collect_one(struct nlmsghdr *h, int family, int type); ...@@ -51,7 +51,7 @@ extern int inet_collect_one(struct nlmsghdr *h, int family, int type);
extern int unix_receive_one(struct nlmsghdr *h, void *); extern int unix_receive_one(struct nlmsghdr *h, void *);
extern int netlink_receive_one(struct nlmsghdr *hdr, void *arg); extern int netlink_receive_one(struct nlmsghdr *hdr, void *arg);
extern int unix_sk_id_add(ino_t ino); extern int unix_sk_id_add(unsigned int ino);
extern int unix_sk_ids_parse(char *optarg); extern int unix_sk_ids_parse(char *optarg);
extern int do_dump_opt(int sk, int level, int name, void *val, int len); extern int do_dump_opt(int sk, int level, int name, void *val, int len);
......
...@@ -159,11 +159,11 @@ static int can_dump_unix_sk(const struct unix_sk_desc *sk) ...@@ -159,11 +159,11 @@ static int can_dump_unix_sk(const struct unix_sk_desc *sk)
return 1; return 1;
} }
static bool unix_sk_exception_lookup_id(ino_t ino) static bool unix_sk_exception_lookup_id(unsigned int ino)
{ {
char id[20]; char id[20];
snprintf(id, sizeof(id), "unix[%lu]", ino); snprintf(id, sizeof(id), "unix[%u]", ino);
if (external_lookup_id(id)) { if (external_lookup_id(id)) {
pr_debug("Found ino %u in exception unix sk list\n", (unsigned int)ino); pr_debug("Found ino %u in exception unix sk list\n", (unsigned int)ino);
return true; return true;
...@@ -1438,14 +1438,14 @@ static int resolve_unix_peers(void *unused) ...@@ -1438,14 +1438,14 @@ static int resolve_unix_peers(void *unused)
return 0; return 0;
} }
int unix_sk_id_add(ino_t ino) int unix_sk_id_add(unsigned int ino)
{ {
char *e_str; char *e_str;
e_str = xmalloc(20); e_str = xmalloc(20);
if (!e_str) if (!e_str)
return -1; return -1;
snprintf(e_str, 20, "unix[%lu]", ino); snprintf(e_str, 20, "unix[%u]", ino);
return add_external(e_str); return add_external(e_str);
} }
...@@ -1462,7 +1462,7 @@ int unix_sk_ids_parse(char *optarg) ...@@ -1462,7 +1462,7 @@ int unix_sk_ids_parse(char *optarg)
if (*iter == ',') if (*iter == ',')
iter++; iter++;
else { else {
ino_t ino = (ino_t)strtoul(iter, &iter, 10); unsigned int ino = strtoul(iter, &iter, 10);
if (0 == ino) { if (0 == ino) {
pr_err("Can't parse unix socket inode from optarg: %s\n", optarg); pr_err("Can't parse unix socket inode from optarg: %s\n", optarg);
......
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