writev_on_pagefault: Use ssize_t type for write(2) return value
authorRostislav Skudnov <rostislav@tuxera.com>
Thu, 5 Oct 2017 12:49:58 +0000 (12:49 +0000)
committerEryu Guan <eguan@redhat.com>
Fri, 6 Oct 2017 12:45:44 +0000 (20:45 +0800)
Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
src/writev_on_pagefault.c

index 17dbfb77ea9e2314f9d4179f23a5c0e186258e58..eaa0c4ba5f191a572e629171275df80e0a137988 100644 (file)
@@ -43,7 +43,7 @@ void usage(char *progname)
 int main(int argc, char *argv[])
 {
        int fd, i, c;
-       size_t ret;
+       ssize_t ret;
        struct iovec *iov;
        int pagesz = 4096;
        char *data = NULL;
@@ -107,7 +107,7 @@ int main(int argc, char *argv[])
        if (ret < 0)
                perror("writev failed");
        else
-               printf("wrote %d bytes\n", (int)ret);
+               printf("wrote %zd bytes\n", ret);
 
        close(fd);
        return 0;