[04/16] mem/page-pipe: Use ssize_t for splice/tee results

Submitted by Cyrill Gorcunov on July 5, 2019, 3:37 p.m.

Details

Message ID 20190705153811.22652-5-gorcunov@gmail.com
State Accepted
Series "mem: Cleanup and fixups"
Headers show

Commit Message

Cyrill Gorcunov July 5, 2019, 3:37 p.m.
Integer value is too short.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 criu/page-pipe.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/page-pipe.c b/criu/page-pipe.c
index 32be2f9812e2..534380b0f1ce 100644
--- a/criu/page-pipe.c
+++ b/criu/page-pipe.c
@@ -389,7 +389,7 @@  int page_pipe_read(struct page_pipe *pp, struct pipe_read_dest *prd,
 	struct page_pipe_buf *ppb;
 	struct iovec *iov = NULL;
 	unsigned long skip = 0, len;
-	int ret;
+	ssize_t ret;
 
 	/*
 	 * Get ppb that contains addr and count length of data between
@@ -418,13 +418,13 @@  int page_pipe_read(struct page_pipe *pp, struct pipe_read_dest *prd,
 
 	ret = tee(ppb->p[0], prd->p[1], len, 0);
 	if (ret != len) {
-		pr_perror("tee: %d", ret);
+		pr_perror("tee: %zd", ret);
 		return -1;
 	}
 
 	ret = splice(prd->p[0], NULL, prd->sink_fd, NULL, skip, 0);
 	if (ret != skip) {
-		pr_perror("splice: %d", ret);
+		pr_perror("splice: %zd", ret);
 		return -1;
 	}
 

Comments

Mike Rapoport July 8, 2019, 12:34 p.m.
On Fri, Jul 05, 2019 at 06:37:59PM +0300, Cyrill Gorcunov wrote:
> Integer value is too short.
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>

Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>

> ---
>  criu/page-pipe.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/criu/page-pipe.c b/criu/page-pipe.c
> index 32be2f9812e2..534380b0f1ce 100644
> --- a/criu/page-pipe.c
> +++ b/criu/page-pipe.c
> @@ -389,7 +389,7 @@ int page_pipe_read(struct page_pipe *pp, struct pipe_read_dest *prd,
>  	struct page_pipe_buf *ppb;
>  	struct iovec *iov = NULL;
>  	unsigned long skip = 0, len;
> -	int ret;
> +	ssize_t ret;
>  
>  	/*
>  	 * Get ppb that contains addr and count length of data between
> @@ -418,13 +418,13 @@ int page_pipe_read(struct page_pipe *pp, struct pipe_read_dest *prd,
>  
>  	ret = tee(ppb->p[0], prd->p[1], len, 0);
>  	if (ret != len) {
> -		pr_perror("tee: %d", ret);
> +		pr_perror("tee: %zd", ret);
>  		return -1;
>  	}
>  
>  	ret = splice(prd->p[0], NULL, prd->sink_fd, NULL, skip, 0);
>  	if (ret != skip) {
> -		pr_perror("splice: %d", ret);
> +		pr_perror("splice: %zd", ret);
>  		return -1;
>  	}
>  
> -- 
> 2.20.1
> 
> _______________________________________________
> CRIU mailing list
> CRIU@openvz.org
> https://lists.openvz.org/mailman/listinfo/criu
>