[CRIU] Re: [PATCH cr] files: rework a function for closing all descriptors

Pavel Emelyanov xemul at parallels.com
Fri Sep 28 11:49:13 EDT 2012


> @@ -496,20 +496,35 @@ static int open_fdinfos(int pid, struct list_head *list, int state)
>  	return ret;
>  }
>  
> -static int close_old_fds(struct pstree_item *me)
> +int close_old_fds(struct pstree_item *me)

Why unstatic?

>  {
> -	/*
> -	 * FIXME -- The existing test_init implementation uses system()
> -	 * which in turn doesn't work when all fds are closed

> @@ -123,6 +123,7 @@ enum sfd_type {
>  extern int init_service_fd(void);
>  extern int get_service_fd(enum sfd_type type);
>  extern bool is_service_fd(int fd, enum sfd_type type);
> +extern bool is_one_of_service_fds(int fd);

is_any_service_fd looks better

>  
>  /* file descriptors template */
>  struct cr_fd_desc_tmpl {


More information about the CRIU mailing list