diff --git a/criu/cr-restore.c b/criu/cr-restore.c index fe322641c..9717b17d1 100644 --- a/criu/cr-restore.c +++ b/criu/cr-restore.c @@ -1035,7 +1035,7 @@ static int restore_one_zombie(CoreEntry *core) static int setup_newborn_fds(struct pstree_item *me) { - if (clone_service_fd(rsti(me)->service_fd_id)) + if (clone_service_fd(me)) return -1; if (!me->parent || diff --git a/criu/include/servicefd.h b/criu/include/servicefd.h index 812396310..25cb68bdd 100644 --- a/criu/include/servicefd.h +++ b/criu/include/servicefd.h @@ -30,7 +30,7 @@ struct pstree_item; extern bool sfds_protected; extern void set_proc_self_fd(int fd); -extern int clone_service_fd(int id); +extern int clone_service_fd(struct pstree_item *me); extern int init_service_fd(void); extern int get_service_fd(enum sfd_type type); extern int install_service_fd(enum sfd_type type, int fd); diff --git a/criu/util.c b/criu/util.c index f91c09f2c..43a975d07 100644 --- a/criu/util.c +++ b/criu/util.c @@ -542,9 +542,11 @@ int close_service_fd(enum sfd_type type) return 0; } -int clone_service_fd(int id) +int clone_service_fd(struct pstree_item *me) { - int ret = -1, i; + int id, i, ret = -1; + + id = rsti(me)->service_fd_id; if (service_fd_id == id) return 0;