Fix various compile warnings
[splice.git] / splice-bench.c
index 8f808a11aee262a04bd5bee8fc08e9230b32fcc0..b21319d00ec9587dc853c7b683d69b39fd462797 100644 (file)
@@ -28,7 +28,7 @@ static int write_to_null;
 static int same_file;
 static int splice_size = SPLICE_SIZE;
 static char *filename = "splice-file";
-static int max_client_run = 15;
+static unsigned int max_client_run = 15;
 static int run_rw = 1;
 static int run_splice = 1;
 static int run_mmap = 1;
@@ -161,7 +161,8 @@ static int server(int offset)
        int sk, opt;
 
        bind_to_cpu(offset);
-       nice(-20);
+       if (nice(-20) < 0)
+               perror("nice");
 
        sk = socket(PF_INET, SOCK_STREAM, 0);
        if (sk < 0)
@@ -329,7 +330,7 @@ again:
        off = 0;
 
        do {
-               int ret = splice(fd, &off, pfd[1], NULL, min(size, (unsigned long long) splice_size), 0);
+               int ret = ssplice(fd, &off, pfd[1], NULL, min(size, (unsigned long long) splice_size), 0);
 
                if (ret <= 0)
                        return error("splice-in");
@@ -337,7 +338,7 @@ again:
                size -= ret;
                while (ret > 0) {
                        int flags = size ? SPLICE_F_MORE : 0;
-                       int written = splice(pfd[0], NULL, out_fd, NULL, ret, flags);
+                       int written = ssplice(pfd[0], NULL, out_fd, NULL, ret, flags);
 
                        if (written <= 0)
                                return error("splice-out");
@@ -420,7 +421,8 @@ static int client(int offset)
        char fname[64];
 
        bind_to_cpu(offset);
-       nice(-20);
+       if (nice(-20) < 0)
+               perror("nice");
 
        if (!write_to_null)
                out_fd = client_open_net(offset);