[CRIU] [PATCH 2/3] pie: don't use pr_perror in pie code

Andrew Vagin avagin at parallels.com
Fri Aug 30 08:29:10 EDT 2013


Pavel, could you commit this patch?

On Thu, Aug 29, 2013 at 11:31:08AM +0400, Andrey Vagin wrote:
> pr_perror uses errno, which is set by glibc wrappers.
> In pi return codes of syscalls should be printed
> 
> Signed-off-by: Andrey Vagin <avagin at openvz.org>
> ---
>  pie/util.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/pie/util.c b/pie/util.c
> index fe3fe4f..51f2aae 100644
> --- a/pie/util.c
> +++ b/pie/util.c
> @@ -152,19 +152,21 @@ int recv_fds(int sock, int *fds, int nr_fds, struct fd_opts *opts)
>  
>  int open_detach_mount(char *dir)
>  {
> -	int fd;
> +	int fd, ret;
>  
>  	fd = sys_open(dir, O_RDONLY | O_DIRECTORY, 0);
>  	if (fd < 0)
> -		pr_perror("Can't open directory");
> +		pr_err("Can't open directory %s: %d\n", dir, fd);
>  
> -	if (sys_umount2(dir, MNT_DETACH)) {
> -		pr_perror("Can't detach mount");
> +	ret = sys_umount2(dir, MNT_DETACH);
> +	if (ret) {
> +		pr_perror("Can't detach mount %s: %d\n", dir, ret);
>  		goto err_close;
>  	}
>  
> -	if (sys_rmdir(dir)) {
> -		pr_perror("Can't remove tmp dir");
> +	ret = sys_rmdir(dir);
> +	if (ret) {
> +		pr_perror("Can't remove tmp dir %s: %d\n", dir, ret);
>  		goto err_close;
>  	}
>  
> -- 
> 1.8.3.1
> 


More information about the CRIU mailing list