]> Sergey Matveev's repositories - nnn.git/commitdiff
Increase pipe capacity
authorArun Prakash Jana <engineerarun@gmail.com>
Sat, 9 May 2020 09:10:52 +0000 (14:40 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Sat, 9 May 2020 09:25:21 +0000 (14:55 +0530)
src/nnn.c

index 0a5dd82fa6ad46fa6c76d89551c179f06a1242ca..b63ea25971a718eb38e5e381bba0025a60b92556 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -4312,6 +4312,15 @@ static bool run_selected_plugin(char **path, const char *file, char *runfile, ch
        if (fd == -1)
                return FALSE;
 
+#ifdef __linux__
+       DPRINTF_D(fcntl(fd, F_GETPIPE_SZ));
+       /* Increase the pipe buffer size to 1 MB */
+       if (fcntl(fd, F_SETPIPE_SZ, 1024*1024) == -1) {
+               DPRINTF_S(strerror(errno));
+       }
+       DPRINTF_D(fcntl(fd, F_GETPIPE_SZ));
+#endif
+
        /* Run plugin from command */
        if (*file == '_')
                run_cmd_as_plugin(*path, file, runfile);