summaryrefslogtreecommitdiff
path: root/findutils
diff options
context:
space:
mode:
Diffstat (limited to 'findutils')
-rw-r--r--findutils/xargs.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/findutils/xargs.c b/findutils/xargs.c
index 5a5e1c6..ec6d99c 100644
--- a/findutils/xargs.c
+++ b/findutils/xargs.c
@@ -311,9 +311,7 @@ static int xargs_ask_confirmation(void)
int c, savec;
if (!tty_stream) {
- tty_stream = fopen("/dev/tty", "r");
- if (!tty_stream)
- bb_perror_msg_and_die("/dev/tty");
+ tty_stream = bb_xfopen(CURRENT_TTY, "r");
/* pranoidal security by vodz */
fcntl(fileno(tty_stream), F_SETFD, FD_CLOEXEC);
}