hush: fix dup_CLOEXEC() call without "avoid_fd" parameter

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2018-06-26 15:50:33 +02:00
parent 8ef9effaa5
commit d1a83234c0

View 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;