+ /* Open tty */
+ fd = open(*argv, O_RDWR | O_NDELAY);
+ if (fd < 0) {
+ char *buf = concat_path_file("/dev", *argv);
+ fd = xopen(buf, O_RDWR | O_NDELAY);
+ /* maybe if (ENABLE_FEATURE_CLEAN_UP) ?? */
+ free(buf);
+ }
+ xmove_fd(fd, serial_fd);
+
+ /* Save current tty state */
+ if (tcgetattr(serial_fd, &G.saved_state) != 0)
+ bb_perror_msg_and_die("tcgetattr");
+ /* Save line discipline */
+ xioctl(serial_fd, TIOCGETD, &G.saved_disc);
+