- fn = argv[1];
- ttyfd = xopen3(CURRENT_TTY, O_RDWR, 0);
- filefd = xopen3(fn, O_RDWR|O_CREAT|O_TRUNC, 0666);
-
- if (tcgetattr(ttyfd, &tty) < 0)
- bb_perror_msg_and_die("%s: tcgetattr failed", argv[0]);
-
- orig_tty = tty;
-
- cfmakeraw(&tty);
- tcsetattr(ttyfd, TCSAFLUSH, &tty);
-
- memset(&act, 0, sizeof(act));
- act.sa_handler = sigalrm_handler;
- sigaction(SIGALRM, &act, 0);
-
- n = receive(error_buf, sizeof(error_buf), ttyfd, filefd);
-
- close(filefd);
+ /* Disabled by vda:
+ * why we can't receive from stdin? Why we *require*
+ * controlling tty?? */
+ /*read_fd = xopen(CURRENT_TTY, O_RDWR);*/
+ file_fd = xopen(single_argv(argv), O_RDWR|O_CREAT|O_TRUNC);
+
+ termios_err = tcgetattr(read_fd, &tty);
+ if (termios_err == 0) {
+//TODO: use set_termios_to_raw()
+ orig_tty = tty;
+ cfmakeraw(&tty);
+ tcsetattr(read_fd, TCSAFLUSH, &tty);
+ }