[CRIU] [PATCH]v2 crtools: write pidfile, when service/page server is run as daemon and "--pidfile" is set

Cyrill Gorcunov gorcunov at gmail.com
Sun Sep 15 17:12:34 EDT 2013


On Mon, Sep 16, 2013 at 12:58:49AM +0400, Ruslan Kuprieiev wrote:
> @@ -971,8 +956,11 @@ static inline int fork_with_pid(struct pstree_item *item)
>  	if (ca.clone_flags & CLONE_NEWPID)
>  		item->pid.real = ret;
>  
> -	if (opts.pidfile && root_item == item)
> -		write_pidfile(opts.pidfile, ret);
> +	if (opts.pidfile && root_item == item) {
> +		ret = write_pidfile(opts.pidfile, ret);
> +		if (ret < 0)
> +			pr_perror("Can't write pidfile");
> +	}

I must admit I have no clue what you're guys doing so it
might be by purpose, but don't you need to exit with error
here if write_pidfile failed or it's safe?


More information about the CRIU mailing list