hush: fix dup_CLOEXEC() call without "avoid_fd" parameter
authorDenys Vlasenko <vda.linux@googlemail.com>
Tue, 26 Jun 2018 13:50:33 +0000 (15:50 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Tue, 26 Jun 2018 13:50:33 +0000 (15:50 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
shell/hush.c

index 8d4478ae5fb9c9e9e8eeae6d21a0493c629c76b7..5d907e20023ed98dc730f9eee01e0806880d3b01 100644 (file)
@@ -9668,7 +9668,7 @@ int hush_main(int argc, char **argv)
                G_interactive_fd = dup_CLOEXEC(STDIN_FILENO, 254);
                if (G_interactive_fd < 0) {
                        /* try to dup to any fd */
-                       G_interactive_fd = dup_CLOEXEC(STDIN_FILENO);
+                       G_interactive_fd = dup_CLOEXEC(STDIN_FILENO, -1);
                        if (G_interactive_fd < 0)
                                /* give up */
                                G_interactive_fd = 0;