diff options
-rw-r--r-- | console-tools/setlogcons.c | 2 | ||||
-rw-r--r-- | findutils/xargs.c | 4 | ||||
-rw-r--r-- | miscutils/rx.c | 2 |
3 files changed, 3 insertions, 5 deletions
diff --git a/console-tools/setlogcons.c b/console-tools/setlogcons.c index 1f0ac524e..32153bd2c 100644 --- a/console-tools/setlogcons.c +++ b/console-tools/setlogcons.c | |||
@@ -27,7 +27,7 @@ extern int setlogcons_main(int argc, char **argv) | |||
27 | if (argc == 2) | 27 | if (argc == 2) |
28 | arg.subarg = atoi(argv[1]); | 28 | arg.subarg = atoi(argv[1]); |
29 | 29 | ||
30 | if (ioctl(bb_xopen("/dev/tty1", O_RDONLY), TIOCLINUX, &arg)) | 30 | if (ioctl(bb_xopen(VC_1, O_RDONLY), TIOCLINUX, &arg)) |
31 | bb_perror_msg_and_die("TIOCLINUX");; | 31 | bb_perror_msg_and_die("TIOCLINUX");; |
32 | 32 | ||
33 | return 0; | 33 | return 0; |
diff --git a/findutils/xargs.c b/findutils/xargs.c index 5a5e1c64c..ec6d99cac 100644 --- a/findutils/xargs.c +++ b/findutils/xargs.c | |||
@@ -311,9 +311,7 @@ static int xargs_ask_confirmation(void) | |||
311 | int c, savec; | 311 | int c, savec; |
312 | 312 | ||
313 | if (!tty_stream) { | 313 | if (!tty_stream) { |
314 | tty_stream = fopen("/dev/tty", "r"); | 314 | tty_stream = bb_xfopen(CURRENT_TTY, "r"); |
315 | if (!tty_stream) | ||
316 | bb_perror_msg_and_die("/dev/tty"); | ||
317 | /* pranoidal security by vodz */ | 315 | /* pranoidal security by vodz */ |
318 | fcntl(fileno(tty_stream), F_SETFD, FD_CLOEXEC); | 316 | fcntl(fileno(tty_stream), F_SETFD, FD_CLOEXEC); |
319 | } | 317 | } |
diff --git a/miscutils/rx.c b/miscutils/rx.c index ef372d383..5fa98b5ef 100644 --- a/miscutils/rx.c +++ b/miscutils/rx.c | |||
@@ -290,7 +290,7 @@ int rx_main(int argc, char **argv) | |||
290 | bb_show_usage(); | 290 | bb_show_usage(); |
291 | 291 | ||
292 | fn = argv[1]; | 292 | fn = argv[1]; |
293 | ttyfd = bb_xopen3("/dev/tty", O_RDWR, 0); | 293 | ttyfd = bb_xopen3(CURRENT_TTY, O_RDWR, 0); |
294 | filefd = bb_xopen3(fn, O_RDWR|O_CREAT|O_TRUNC, 0666); | 294 | filefd = bb_xopen3(fn, O_RDWR|O_CREAT|O_TRUNC, 0666); |
295 | 295 | ||
296 | if (tcgetattr(ttyfd, &tty) < 0) | 296 | if (tcgetattr(ttyfd, &tty) < 0) |