splice: use fcntl(pfd[1], F_SETPIPE_SZ, buffer_size); in splice2.c master
authorStefan Metzmacher <metze@samba.org>
Fri, 5 Apr 2013 07:09:20 +0000 (09:09 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 5 Apr 2013 07:09:20 +0000 (09:09 +0200)
metze

splice/splice2.c

index 3b90d50a66540b1fdf94458dbf469ae20b3b4c3f..3ebade98e396408f068a78df93633729074a3160 100644 (file)
@@ -32,7 +32,8 @@ int main(int argc, const char * const *argv)
 
        if (strcmp(argv[1], "splice") == 0) {
                pipe(pfd);
-               fcntl(pfd[1], F_SETPIPE_SZ, 1048576);
+               fcntl(pfd[1], F_SETPIPE_SZ, buffer_size);
+               buffer_size = fcntl(pfd[1], F_GETPIPE_SZ);
        } else {
                buffer = malloc(buffer_size);
        }